is there "elegant" way to give specific property a default value ?
Maybe by DataAnnotations, something like :
[DefaultValue("true")] public bool Active { get; set; }
Thank you.
You can do it by manually edit code first migration:
public override void Up() { AddColumn("dbo.Events", "Active", c => c.Boolean(nullable: false, defaultValue: true)); }
1.4m articles
1.4m replys
5 comments
57.0k users