Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confused exception message when SubclassMap duplicated map a property of baseclass. #380

Open
phiree opened this issue Oct 10, 2017 · 2 comments

Comments

@phiree
Copy link

phiree commented Oct 10, 2017

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"...

@LIZIQIANG123
Copy link

How do you solve this problem?,could you telll me

@phiree
Copy link
Author

phiree commented Aug 19, 2019

just don't map "Name" again .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants