摘要: Repository模式定义:协调领域和数据映射层,利用类似于集合的接口来访问领域对象。使用此模式最大的好处是将领域模型从客户代码和数据映射层之间解耦出来。接下来给出一个在Castle ActiveRecord中使用该模式的demo实体层代码 1: [ActiveRecord("Posts")] 2: public class Post:ActiveRecordBase<Post> 3: { 4: [PrimaryKey("PostId")] 5: public int Id { get; set; } 6: 7: [Prop... 阅读全文
posted @ 2012-12-05 21:44 Ian.w 阅读(799) 评论(2) 推荐(0)