views:

45

answers:

1

I'm trying to code my domain to interfaces types rather than concrete types.

Skeleton examples of two domain objects are:

public class Supplier : ISupplier
{
   public virtual IContract Contract {get; set;}
}

public class Contract : IContract
{
   public virtual List<ISuppliers> Suppliers {get; set;}
}

Is there a way to Fluently map my supplier so that it will cast to concrete domain objects for data access?

I currently get the error

NHibernate.MappingException: An association from the table Supplier refers to an unmapped class: IContract

With the following supplierMap

References(x => x.Contract).Column("ContractId")
A: 

Try:

References<Contract>(x => x.Contract).Column("ContractId");

From here.

chum of chance
Much Obliged Chum - Works a treat. My Google foo deserted me when I posted!
ActualAl

related questions