Entity Framework 6 Code first Default value

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.

17 Answers
17

Leave a Comment