简体   繁体   English

首先使用属性在代码EF 4.1中配置TPH Discriminator列

[英]Configure TPH Discriminator column in code first EF 4.1 using attributes

I have a .NET code first EF 4.1 set of objects that I am configuring with attributes. 我有一个.NET代码,首先是我使用属性配置的EF 4.1对象集。

I would like to rename the column used as the discriminator for my Type-Per-Hierarchy inheritance and also control the values of the discriminator column. 我想重命名用作我的Type-Per-Hierarchy继承的鉴别器的列,并且还控制鉴别器列的值。

I've seen examples of how to do this with fluent mapping, but since I am using attributes everywhere else, I'd like to be consistent and configure it using attributes. 我已经看到了如何使用流畅映射执行此操作的示例,但由于我在其他地方使用属性,因此我希望保持一致并使用属性进行配置。 Is this even possible? 这甚至可能吗?

使用属性不可能做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM