Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 LinqToEntity 映射一个名为 category 的表,其中 Id 作为主键,该表具有名为 ParenCategoryId 的自我引用?
创建一个从 ID 指向 ParentCategoryID 的 FK。EF 应该从那里获取导航属性。该名称将毫无用处,因此您必须做一些额外的工作(通过代码生成器或 T4 模板)才能将其重命名为更适合的名称,例如“ParentCategory”。