Fluent NHibernate HasMany Foreign Key Mapping Problem

后端 未结 3 1046
终归单人心
终归单人心 2021-02-06 04:20

I\'m trying to map a simple data structure in nhibernate

Tables:

Employees
employeeID int
username varchar(30)
departmentID int

Departm         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 04:42

    You need to specify the key column.

    HasMany(m => m.Employees).KeyColumn("DepartmentId");
    

提交回复
热议问题