Programming to interfaces while mapping with Fluent NHibernate.

Posted by Lucious on Stack Overflow See other posts from Stack Overflow or by Lucious
Published on 2010-03-20T10:43:15Z Indexed on 2010/03/20 10:51 UTC
Read the original article Hit count: 169

Filed under:

Fluent Mapping I Have the following scenario

public class CustomerMap : ClassMap { public CustomerMap() { Table("Customer"); Id(c => c.Id); Map(c => c.Name); HasMany(c => c.Orders); } }

public class OrderMap : ClassMap<IOrder>
{
    public OrderMap()
    {
        Table("Orders");
        References(o => o.Customer).Access.;
        Id(o => o.Id);
        Map(o => o.DateCreated);
    }
}

Problems

  1. When schema exported the order table has two columns ICustomer_Id,Customer_Id.
  2. refers to an unmapped class Order exception

Can you please help me out?

© Stack Overflow or respective owner

Related posts about fluent-nhibernate