<#+ // <copyright file="Container.tt" company="Webbert Solutions, LLC"> // Copyright © Webbert Solutions, LLC. All Rights Reserved. // </copyright> /// <summary> /// /// </summary> public class ContainerModel : Template { public Container container; /// <summary> /// /// </summary> public override string TransformText() { #> using System; using System.Data.EntityClient; using EFPocoAdapter; namespace <#= container.Entities[0].Entity.EntityTypeNamespace #> { public interface I<#= container.Name #> { <#+ foreach (EntitySet entitySet in container.Entities) { #> IEntitySet<<#= entitySet.Entity.EntityTypeNamespace #>.<#= entitySet.Entity.EntityTypeName #>> <#= entitySet.Name #> { get; } <#+ } #> } public partial class <#= container.Name #> : EFPocoContext<<#= container.Entities[0].Entity.EntityTypeNamespace #>.PocoAdapters.<#= container.Name #>Adapter>, I<#= container.Name #> { public <#= container.Name #>() : base(new <#= container.Entities[0].Entity.EntityTypeNamespace #>.PocoAdapters.<#= container.Name #>Adapter()) { } public <#= container.Name #>(string connectionString) : base(new <#= container.Entities[0].Entity.EntityTypeNamespace #>.PocoAdapters.<#= container.Name #>Adapter(connectionString)) { } public <#= container.Name #>(EntityConnection connection) : base(new <#= container.Entities[0].Entity.EntityTypeNamespace #>.PocoAdapters.<#= container.Name #>Adapter(connection)) { } <#+ foreach (EntitySet entitySet in container.Entities) { #> public IEntitySet<<#= entitySet.Entity.EntityTypeNamespace #>.<#= entitySet.Entity.EntityTypeName #>> <#= entitySet.Name #> { get { return GetEntitySet<<#= entitySet.Entity.EntityTypeNamespace #>.<#= entitySet.Entity.EntityTypeName #>>("<#= entitySet.Name #>"); } } <#+ } #> } } <#+ return this.GenerationEnvironment.ToString(); } } #>
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)