Closed tpluscode closed 10 years ago
The problem is that a type nested inside a generic type cannot be instantiated. That's also true if otherwise the type would have been constructable. The solution is to map the base type and move the map class to outer scope
public class Base<T> : IBase
{
public int InBaseClass { get; set; }
}
public class BaseMap : EntityMap<IBase>
{
public BaseMap()
{
Property(e => e.InBaseClass).Term.Is("ex", "inBaseClass");
}
}
Fluent mappings can be created to map concrete classes.
It has been discovered that mapping type nested inside the mapped class doesn't work if the type is generic. Here's an example: