New Posts New Posts RSS Feed: Autogenerated Developer Classes have wrong namespace
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Autogenerated Developer Classes have wrong namespace

 Post Reply Post Reply
Author
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Topic: Autogenerated Developer Classes have wrong namespace
    Posted: 10-May-2010 at 4:51pm

Yes, you can set the namespace on the generated DevForce Entities by going to the Properties page of the .tt file and setting the Custom Tool Namespace to whatever you want.

Double check that you do this on the .edmx.tt file as the regular .edmx file is for the raw Entity Framework and won't affect the DevForce code generation.
 
 
Back to Top
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Posted: 07-May-2010 at 2:37pm
I have an edmx where the namespace is defined as Data.Core, when I set Generate Developer Classes the namespace they belong to is Data.

I've attempted to extend the DomainModelTemplate to write out the namespace properly but the temporary file that gets generated during the process has the following error: Compiling transformation: The type or namespace name 'Data' could not be found (are you missing a using directive or an assembly reference?)    c:\Users\jpinchot.TRADE\AppData\Local\Temp\4q4ezyop.0.cs

Is there another way to define the namespace that the developer classes get defined in? Or is there anything wrong with the following tt file?

<#@ template  language="C#" debug="true" hostSpecific="true" #>
<#@ output extension=".ReadMe" #>
<#@ Assembly Name="System.Core.dll" #>
<#@ Assembly Name="IdeaBlade.VisualStudio.DTE.dll" #>
<#@ Assembly Name="IdeaBlade.VisualStudio.OM.CodeGenerator.dll" #>
<#@ Assembly Name="IdeaBlade.EntityModel.Edm.Metadata.dll" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Reflection" #>
<#@ import namespace="IdeaBlade.VisualStudio.DTE" #>
<#@ import namespace="IdeaBlade.VisualStudio.OM.CodeGenerator" #>
<#@ import namespace="IdeaBlade.EntityModel.Edm.Metadata" #>
<#@ import namespace="Data" #>
<#
    // Source for this file located at: C:\Users\jpinchot.TRADE\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\IdeaBlade, Inc\IdeaBlade OM Designer Extension\6.0.1.0\DomainModelTemplate.tt
    // Core.edmx  <--- This is needed so that "Transform Related Text Templates On Save" works correctly.
    var template = new CoreDomainModelTemplate(this);
    template.Generate();
#>
<#+
#>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down