Where are types used in Entity Framework T4 templates defined?

entity-framework entity-framework-6 t4

Accepted Answer

At the start of the file in the Entity Framework T4 template is the include directive. For C#, it will resemble:

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

The Visual Studio IDE extensions folder contains this file. For instance, in Visual Studio 2017 it will be set to:

c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\

The utility classes in this file are used to create entities. E.g.

/// <summary>
/// Responsible for encapsulating the retrieval and translation of the CodeGeneration
/// annotations in the EntityFramework Metadata to form that is useful in code generation.
/// </summary>
public static class Accessibility

Third classTypeMapper the context creation template itself defines.

3
4/12/2017 11:46:08 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow