Database design 如何使用此表结构处理EF4

Database design 如何使用此表结构处理EF4,database-design,entity-framework-4,Database Design,Entity Framework 4,我有一个公用表来存储系统上的注释,如下所示: id <- PK Text <- user content userId createdAt commentType <- a discriminator, to know which entity is the parent of this comment ie: N: News, A:Articles, and so on... typeId <- Id of the parent entity mapping.Ha

我有一个公用表来存储系统上的注释,如下所示:

id   <- PK
Text <- user content
userId
createdAt
commentType <- a discriminator, to know which entity is the parent of this comment ie: N: News, A:Articles, and so on...
typeId <- Id of the parent entity
mapping.HasMany(x=> x.Comments)
.Cascade.All()
.Inverse()
.Where("commentType='A'")
.KeyColumn("typeId")
如何在EF4上使用这种类型的结构?

我想这正是您想要的

基本上,您必须为每种描述符创建一个实体,其中包含的是实体中的where,而不是映射