79158366

Date: 2024-11-05 09:07:51
Score: 0.5
Natty:
Report link

Since migrations don't take any notice of the Auto properties (per the rescinded answer above), even in .Net/EF 8, the best way to do this is within the OnModelCreating method for the Data Context:

modelBuilder.Entity<Revision>().Property(e => e.IsReleased).HasDefaultValue(true);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Webreaper