我有我的所有实体类型的基类,这是像地图通用EntityBase <TEntity>类FluentNHibernate
public abstract class EntityBase<TEntityType> : IEntityBase where TEntityType : EntityBase<TEntityType>
{
private List<IBusinessRule> _brokenRules = new List<IBusinessRule>();
private int? _hashCode;
public int ID { private set; get; }
,并在我的映射我想使用表每类策略,但如何映射这个EntityBase类?我尝试了公共类EntityBaseMap:ClassMap,但它不起作用。 那么我怎么能映射这个类?我为什么要这样做的原因是我不想用Id(c=c.ID).Not.Null ....
等写出重复的东西,但它在一个映射类。
我的映射类这个样子的
public class EntityBaseMap : ClassMap<EntityBase<???>>
我应该插入的,而不是???
感谢
你是什么意思 “*它不工作*”?你有任何错误? – 2012-03-09 09:10:32
它甚至不编译。我不能使用任何类型,因为在映射期间我不知道TEntityType – Ivan 2012-03-09 09:12:48