Fluent Nhibernate generates invalid column names in one-to-many list

Fluent NHibernate Generates invalid column names in many-to-many relationships.

enter public EmployeeMap()
    {
        Id(x => x.EmployeeID);
        Map(x => x.FirstName);
        Map(x => x.LastName);
        Map(x => x.City);
        Map(x => x.HireDate);
        Map(x => x.Title);
        HasMany(x => x.Orders)
            .WithForeignKeyConstraintName("EmployeeID")
            .Inverse()
            .Cascade.All();



    }

      

Received HBM:

<bag name="Orders" inverse="true" cascade="all">
  <key foreign-key="EmployeeID" column="Employees_id" />
  <one-to-many class="FluentWeb.Domain.Orders, FluentWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>

      

Pay attention to the "Employees_id". I saw another post where people are using the "WithKeyColumn (" EmployeeID ") method. This method is not available. What can I do?

thanks

+1


a source to share


1 answer


Below is the solution:

.KeyColumnNames.Add("CustomerName") 

      



-Nick

+4


a source







All Articles