2009-10-12 54 views

回答

1

您將需要使用ActiveRecord模板來使審計字段自動填充。 SimpleRepository不提供除簡單數據訪問之外的任何其他功能,因此您需要自行填充這些字段。

0

我真的想完全堅持SimpleRepository,它非常適合我們的需求。

所以我的直接解決方案是讓所有我的域模型類從DataEntity抽象類繼承:

public abstract class DataEntity { 

     public string Name { get; set; } 
     public int ID { get; set; } 

     public string CreatedBy { get; set; } 
     public DateTime CreatedOn { get; set; } 
     public string ModifiedBy { get; set; } 
     public DateTime ModifiedOn { get; set; } 
     public bool IsDeleted { get; set; } 

     } 

什麼每個人都認爲?這些屬性不僅僅用於簿記,它們與應用程序域模型有關,因此我認爲將它們作爲DAL的第一類成員會更好。