简体   繁体   English

Edmx 实体模型继承

[英]Edmx Entity model inheritance

I want to create a generic Entity Model, with some classes and logics above, to put into a DLL and reuse that in various projects.我想创建一个通用的实体模型,上面有一些类和逻辑,放入一个 DLL 并在各种项目中重用它。 I keep in mind the possibility to extend the generic ModelContainer in another in every project and use the extended ModelContainer to access database.我牢记在每个项目的另一个中扩展通用 ModelContainer 并使用扩展的 ModelContainer 访问数据库的可能性。 I ask you if it is possible to do so in a "clean way" or I need some work around or "bad stuff".我问你是否有可能以“干净的方式”这样做,或者我需要一些解决方法或“坏事”。 Thank you all.谢谢你们。

I did not understand what you want exactly but i think you want to extend the entities generated by edmx .我不明白你到底想要什么,但我认为你想扩展edmx生成的实体。

You can do this by using Partial Classes or Extension Methods .您可以通过使用Partial ClassesExtension Methods来做到这一点。

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

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