具有接口类型引用的域对象的流畅 NHibernate 映射(在 S#arp arch 应用程序中)
我正在尝试将我的域编码为接口类型而不是具体类型。
两个域对象的骨架示例是:
public class Supplier : ISupplier
{
public virtual IContract Contract {get; set;}
}
public class Contract : IContract
{
public virtual List<ISuppliers> Suppliers {get; set;}
}
有没有一种方法可以流畅地映射我的供应商,以便它将转换为具体的域对象以进行数据访问?
我当前收到错误
NHibernate.MappingException:表Supplier 中的关联引用了未映射的类:IContract
具有以下supplierMap
References(x => x.Contract).Column("ContractId")
I'm trying to code my domain to interfaces types rather than concrete types.
Skeleton examples of two domain objects are:
public class Supplier : ISupplier
{
public virtual IContract Contract {get; set;}
}
public class Contract : IContract
{
public virtual List<ISuppliers> Suppliers {get; set;}
}
Is there a way to Fluently map my supplier so that it will cast to concrete domain objects for data access?
I currently get the error
NHibernate.MappingException: An association from the table Supplier refers to an unmapped class: IContract
With the following supplierMap
References(x => x.Contract).Column("ContractId")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
从此处。
Try:
From here.