Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

c# - Changing Namespaces in Entity Framework

I am trying to change the Namespace used by Entity Framework Generator of classes.

When I click the designer of my Entity, Model.edmx, I can see somewhere where I can change the namespace:

Namespace

under ConceptualEntityModel properties. Changed that namespace, but nothing happened. Didn't work. So, I read some help from this link:

http://weblogs.asp.net/zeeshanhirani/struggling-through-namespace-in-entity-framework

says that I have to change the property: Custom Tool Namespace

That's nice, when I click property of .edmx in console application, there property is there. But when I am using the same thing in a Web Application, the property is not there. There is only a property file called Web File Properties that simply has 3 properties:

  • Custom Tool
  • File Name
  • Full Path

What am I missing here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

rainerh is right:

I tried to set *.edmx Custom Tool Namespace property - this did not help.
I tried to set *.Context.tt property - this did not help too.
But when I set Custom Tool Namespace property of *.tt file (right-click on the file -> Properties) - namespace was set automatically for all the classes genereated before.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...