18

In entity framework T4 templates, I can use class CodeGenerationTools.

For example:

void WriteProperty(**CodeGenerationTools** code, EdmProperty edmProperty)
{
    WriteProperty(Accessibility.ForProperty(edmProperty),
                  code.Escape(edmProperty.TypeUsage),
                  code.Escape(edmProperty),
                  code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
                  code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
}

However, I can't find where this class is defined.

Which assembly does it come from? What are its members?

Thanks

user380719
  • 9,663
  • 15
  • 54
  • 89

1 Answers1

19

That is not class from assembly. It is included class from another template:

<#@ include file="EF.Utility.CS.ttinclude"#>

This files is normally stored in VS installation directory:

%VSINSTALLDIR%\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes
Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • 1
    How safe do you think it is to pull the class into code? I ask because I am trying to map a `bool` to Oracle's `NUMBER(1,0)` without a true "model first" approach. I used an EDMX writer to parse my `DbContext` to xml and build the DB, and now am using the fluent API to map to the existing table... the issue is with the oddball mapping above. It works fine with model first, so I'm trying to figure out how I can do it programmatically. I think it is the TT transformation mentioned above. – one.beat.consumer Nov 21 '12 at 18:17