实体框架5部分类不工作 [英] Entity Framework 5 partial classes not working

查看:106
本文介绍了实体框架5部分类不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用EF 5,我已经产生从数据库中我的模型。那么我想创造一些局部类延长EF生成的类的功能。在EF 4我曾经仅仅是能够把命名空间的,我想使用这些类到EDMX文件的自定义工具命名空间的属性。然而,在EF 5这似乎被忽略。不管是什么,我把在自定义工具命名空间它只是不断生成的EF类的默认命名空间!我能明显改变我的部分类的命名空间,但我宁愿能够使用自己的命名空间他们。如何在地球上我这样做EF5?

I am using EF 5 and I have generated my model from a database. I then want to create some partial classes to extend the functionality of the EF generated classes. In EF 4 I used to simply be able to Put the namespace of the I wanted to use for these classes in to the "Custom Tool Namespace" property of the edmx file. However in EF 5 this seems to be ignored. No matter what I put in the "Custom Tool Namespace" it just keeps generating the the EF classes in the default namespace! I can obviously change the namespace of my partial classes, but I would rather be able to use my own namespaces for them. How on earth do I do this in EF5?

推荐答案

在模型设计(的.edmx)的性能模式下,有一个命名空间属性,您可以在这里设置你的命名空间。

In the Properties of the Model Designer (.edmx) under schema there is a Namespace Property, you can set your namespace here.

这篇关于实体框架5部分类不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆