allow modifieddate to be null

This commit is contained in:
Collin M. Barrett 2017-04-10 18:22:18 -05:00
parent 5753eb1382
commit a59dc92259

View file

@ -13,15 +13,13 @@ public abstract class BaseEntity
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
[Required]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
//TODO: Implement http://stackoverflow.com/a/38102266/2343739 so DefaultValue takes effect in db automatically
//For now, manually execute on new tables: InitializeNewTableBaseEntityDefaults.sql
[DefaultValue("CURRENT_TIMESTAMP")]
public DateTime AddedDateUtc { get; set; }
[Required]
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
[DefaultValue("CURRENT_TIMESTAMP")]
public DateTime ModifiedDateUtc { get; set; }
public DateTime? ModifiedDateUtc { get; set; }
}
}