I have a base class for all my entity types which is like
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; }
and in my mappings i would like to use table-per-class strategy but how to map this EntityBase class? I tryed public class EntityBaseMap:ClassMap but it doesnt work.
So how could i map this class? The reason why I want that is I dont want to write the repetetive stuff with Id(c=c.ID).Not.Null .... etc but have it in one mapping class.
my mapping class look like this
public class EntityBaseMap : ClassMap<EntityBase<???>>
what should i insert instead of ???
Thanks
In NHibernate you can’t map a class with an open generic, such as
EntityBase<TEntityType>. Unfortunately you’ll have to define a mapping class for each of the entities: