Answer the question
In order to leave comments, you need to log in
Why doesn't EF populate the value?
ASP Core project with EF Core.
In Context Code
modelBuilder.Entity<Table>(option => {
option.Property(p => p.Guid)
.ValueGeneratedOnAdd()
.IsRequired();
});
var newTable = new Table()
newTable.Guid = new Guid();
context.MyTables.Add(newTable);
context.SaveChanges();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question