fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

How to map a list of an interface to a concrete class

Open jagregory opened this issue 14 years ago • 1 comments
trafficstars

I'd like to map a list of an interface This is my object:

public class Foo
{
  public virtual IList<IBar> Bars { get; protected set; }
}

I have several implementations of IBar in my domain model. How do I specify which IBar implementation Foo is using with Fluent NHibernate? I'm using auto mapping and would love if there was a solution with overrides.

I feel like there's a missing Class() method somewhere, but I don't know how to map this with NHibernate, so I'm not sure what I want to do is even possible.

jagregory avatar Jul 21 '11 22:07 jagregory

Any info on this? I am running into this as well

ravensorb avatar Feb 14 '18 20:02 ravensorb