How can I add default values to a property when saving using Code First EF4.1?

前端 未结 3 2167
夕颜
夕颜 2020-12-31 13:22

I started by creating some models like this:

public abstract class EditableBase
{
    public DateTime CreatedOn { get; set; }
    public DateTime ModifiedOn          


        
3条回答
  •  难免孤独
    2020-12-31 14:06

    Well, you have complete control over the code for your entities. I'd imagine you would probably want to implement an IPropertyChanged like pattern to update your properties.

提交回复
热议问题