一、前言
在上一篇中(如何一步一步用DDD设计一个电商网站(八)—— 会员价的集成),有一行注释的代码:
public interface IRoleDiscountRelationRepository// : IRepository<RoleDiscountRelation> {
RoleDiscountRelation Get(string roleId);
}其中涉及的到问题是关于值对象的持久化问题。是的,由于我们之前的设计中持久化是仅针对聚合根的:
public interface IRepository<T> where T : AggregateRoot
{ string NextIdentity(); void Save(T aggregate);
T


