I\'m working on an application where one can get information on movies from a database as well as add, update and delete the movies. In the database I have three tables (Movie,
In my case I was using EF Core and the issue was that the field was nullable in the database but in the ModelCreating it was required like that:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity(entity =>
{
entity.Property(e => e.Details)
.IsRequired()
.HasMaxLength(250);
}
}
I remove the IsRequired() and it worked fine.
Update few days after, Got same issue, a string field It was not allowing null in the DB.