简体   繁体   English

部分类和edmx

[英]Partial class and edmx

My edmx file generate some partial classes. 我的edmx文件生成了一些partial类。 I want extend functionality adding one property, but edmx file is in another assembly. 我想扩展功能添加一个属性,但edmx文件在另一个程序edmx In this case they are like two unrelated classes. 在这种情况下,它们就像两个不相关的类。

How can I solve this? 我怎么解决这个问题?

您可以从edmx生成的实体类型继承另一个type ,并将您的属性添加到继承的类型。

您可以在程序集中创建一个新类,它将扩展/继承部分类,并根据需要添加属性和方法

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

相关问题 dbContext生成器或子类-用于修改生成的默认edmx代码的哪个? - DbContext generator or partial class - which to use to modify the default edmx code generated? 从edmx模型生成odata类 - odata class generation from edmx model ASP.NET MVC 5 中自动生成的 EDMX class 的构造函数 - Constructors for Auto Generated EDMX class in ASP.NET MVC 5 为什么我的部分视图在带有EDMX模型的ASP.NET MVC4中不显示任何内容 - Why is my Partial View is not Showing anything in ASP.NET MVC4 with EDMX model 如何从实体数据模型(edmx)生成数据上下文类? - How to generate data context class from entity data model (edmx)? 结合EF Power Tools和.edmx生成CodeFirst Class和DB - Combine EF Power Tools and .edmx to generate CodeFirst Class And DB 无法在 class inheritance 在 ADO .NET 实体 ZA559B87068921EEC05086CE5485E978 中执行覆盖 - cannot perform override in class inheritance in ADO .NET Entity Model edmx 如何使用带有剃刀视图的实体框架(.edmx模型)为MVC4或MVC 5创建局部视图? - How can i create a Partial View for MVC4 or MVC 5 using Entity Framework (.edmx Model) with Razor Views? 为部分类禁用DebuggerStepThrough - disable DebuggerStepThrough for partial class 局部类中的调用方法 - Call method in partial class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM