0
我有一個共同的表來存儲我的系統上的評論是這樣工作的:我如何使用EF4此表結構
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
我使用NHibernate喜歡這個工作之前,這種類型的結構:
mapping.HasMany(x=> x.Comments)
.Cascade.All()
.Inverse()
.Where("commentType='A'")
.KeyColumn("typeId")
我如何在EF4上使用這種類型的結構?