fluent-nhibernate
fluent-nhibernate copied to clipboard
confused exception message when SubclassMap duplicated map a property of baseclass.
Entities:
class Base
{
public string Id{get;set;}
public string Name{get;set;}
}
class MyClass:Base
{
public int Age{get;set;}
}
Mapping:
class BaseMap:ClassMap<Base>
{
Id(x=>x.Id);
Map(x=>x.Name);
}
class MyClassMap:SubClassMap<MyClass>
{
Map(x=>x.Name); <---------------------Wrong in runtime.
}
this incorrect map throw System.ArgumentOutOfRangeException . it is confused. it maybe " don't mapping same property of base class"...
How do you solve this problem?,could you telll me
just don't map "Name" again .