I have the following situation:
AssemblyX with db entities refers external assemblyY and use its classes as base classes. AssemblyX adds some navigation properties if necessary.
Of course I can copy all this entites and use automapper to solve my problem, but I have a reason to inherit existent entities.
So, I have Foo {} class in assemblyY and create Bar: Foo {} in assemblyX. Configure fluent automapping to ignore Foo (.IgnoreBase<Foo>()). Everything works good. But assemblyY has another entity Rab (that is covered by fluent automapping) that has a navigation property that refers to Foo. That cause an exception: "An association from the table Rab refers to an unmapped class: Foo".
public class Foo // .IgnoreBase<Foo>() - I require only derived Bar in DB
{
public virtual Guid Id {get; set;}
}
public class Bar: Foo
{
public virtual Guid Id {get; set;}
// Some new properties
}
public class Rab
{
public virtual Guid Id {get; set;}
public virtual Foo Foo // reference to unmapped class, I could not change type to Bar (external assembly)
}
How can I solve it. I tried to inherit the Rab and create new Foo property with Bar type, but unsuccessfully.
Thanks in advance for any advice.