In What Assembly is System.Data.Entity.ModelConfiguration.Mappers.TypeMapper Defined?
.net, entity-framework, t4
Solution
It seems to be defined in the very same .tt file - around line 320.
Problem
I'm trying to build a simple C# template for some EF 6.0 stuff. I created the template in the same project that defines all of the Entity Framework objects. However, I seem unable to use some of the types that can be found just fine in the Entity generator, specifically, `TypeMapper`. Here is the top of my Entity generator T4 file: ``` <#@ template language="C#" debug="false" hostspecific="true"#> <#@ include file="EF.Utility.CS.ttinclude"#> <#@ output extension=".cs"#> <# const string inputFile = @"EpicCloudDB.edmx"; #> <#@ include file="EdmxEnumFixer.t4" #> <# var textTransform = DynamicTextTransformation.Create(this); var code = new CodeGenerationTools(this); var ef = new MetadataTools(this); var typeMapper = new TypeMapper(code, ef, textTransform.Errors); var fileManager = EntityFrameworkTemplateFileManager.Create(this); var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile); var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef); #> ``` Nothing crazy going on here. However, if I create a template and paste that directly into it (same project) it fails to find the following types: - TypeMapper - CodeStringGenerator - EdmMetadataLoader I am in need of the TypeMapper only, but I don't understand why the same template code doesn't work in a fresh template, but runs just fine in the default EF file. These classes are not easy to find documentation on either. I figure if I can just find which assembly defines `TypeMapper` I can add the reference manually and worry about the general weirdness later, but that has proven more difficult than I expected. So how can I get this type imported into my template? I'll grep through the EF 6 source while I wait for an answer here.