Mapping a self-join to a collection in code first entity framework 4.3
问题 I have a POCO class that maps to a self-joined table defined like this: CREATE TABLE [dbo].[GalleryCategories]( [CategoryID] [int] IDENTITY(0,1) NOT NULL PRIMARY KEY CLUSTERED, [Name] [nvarchar](256) NOT NULL, [ParentID] [int] NULL REFERENCES [dbo].[GalleryCategories] ([CategoryID]) ON DELETE NO ACTION ON UPDATE NO ACTION, ) I know there's a way to define a relationship using the model builder to reference a parent from a child... (e.g. like this) But the class I'm trying to map looks like