0
votes

How to map an interface using fluent Nhibernate

class Product {

public virtual IProductStructure ProductStructure { get; set; }

}


 public class ProductMap : SubclassMap<Product>
    {
        public ProductMap()
        {
            HasOne(x => x.IProductStructure).PropertyRef(x => x.Product).Cascade.All();
        }
    }

public interface IProductStructure
    {
        Product Product { get; set; }
    }

error : NHibernate.MappingException : property-ref to unmapped class: .....Test.IStructure thanks .

1

1 Answers

0
votes

Your mapping needs to be to a concrete class. In your case to the implementation of IProductStructure.