我想为复合id中的1个元素指定类映射:
CompositeId()
.KeyReference(x => x.User, "user_id")
.KeyProperty(x => x.Key, "user_key");
喜欢这个:
References(x => x.User, "user_id").Class<User>()
但是我因为使用接口而得到了未映射类的错误。我也尝试了下面的代码,但没有运气:
CompositeId()
.KeyReference(x => x.User, e =>
e.Name(""user_id").EntityName("User"))
.KeyProperty(x => x.Key, "user_key");
References(x => x.User, "user_id").Class<User>()