I have the following scenario:
public class Login
{
public virtual int Id { get; set; }
public virtual string Username { get; set; }
}
public class User : Login
{
public IList<Account> Accounts { get; set; }
}
If I have two maps (ClassMap<Login> and ClassMap<User>), all queries returns double results – one per maps I’d guess.
Is it possible to avoid this? I don’t have a discriminator value. There are a lot more properties on the user, so I’d like to be able to just get a sub set of these via the login.
Since User extends Login, querying Login will, by default, return User instances too.
To avoid this,
polymorphism="explicit"must be used in the XML mappings.For Fluent mappings, use
Polymorphism.Explicit().