I upgraded from .Net Core 2.2 to 3.1 and this functionality has been deprecated
modelBuilder
.Entity<Order>()
.Property(e => e.CreationTime)
.ValueGeneratedOnAddOrUpdate()
.Metadata.IsStoreGeneratedAlways = true;
I need EF to do the Insert but block the update.
Thanks!
According to the obsoleted property implementation:
the equivalent code should set
BeforeSaveBehavior
andAfterSaveBehavior
toIgnore
.Also since
BeforeSaveBehavior
andAfterSaveBehavior
properties have been replaced withGet
/Set
method pairs, it would require introducing a temporary variable to hold the property metadata.Something like this: