How can I add default values to a property when saving using Code First EF4.1?
I started by creating some models like this: public abstract class EditableBase { public DateTime CreatedOn { get; set; } public DateTime ModifiedOn { get; set; } public int CreatedBy { get; set; } public int ModifiedBy { get; set; } } public class Project : EditableBase { public int ProjectId { get; set; } public string ProjectName { get; set; } } And I use this line when the app starts: Database.SetInitializer<ModelContext>( new DropCreateDatabaseIfModelChanges<ModelContext>()); A table called Projects is created with all the properties mentioned above as columns... this is exactly what I