Skip to content

Commit 802d01b

Browse files
committed
Minor tidy up
1 parent 999abe6 commit 802d01b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

EntityFramework.Reverse.POCO.Generator/Database NorthwindSqlCe40.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
Namespace = "EntityFramework_Reverse_POCO_Generator.SqlCe4"; // Override the default namespace here
1616
DbContextName = "MyDbContextSqlCE4";
17-
//DbContextInterfaceName = "IMyDbContext"; //Defaults to "I" + DbContextName
1817
DbContextInterfaceBaseClasses = "System.IDisposable"; // Specify what the base classes are for your database context interface
1918
DbContextBaseClass = "System.Data.Entity.DbContext"; // Specify what the base class is for your DbContext. For ASP.NET Identity use "IdentityDbContext<ApplicationUser>"
2019
//DefaultConstructorArgument = "EnvironmentConnectionStrings.MyDbContext"; //defaults to "Name=" + ConnectionStringName

EntityFramework.Reverse.POCO.Generator/Database.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Namespace = ""; // Override the default namespace here
1616
DbContextName = "MyDbContext";
17-
//DbContextInterfaceName = "IMyDbContext"; //Defaults to "I" + DbContextName or set string empty to not implement any interface.
17+
//DbContextInterfaceName = "IMyDbContext"; // Defaults to "I" + DbContextName or set string empty to not implement any interface.
1818
DbContextInterfaceBaseClasses = "System.IDisposable"; // Specify what the base classes are for your database context interface
1919
DbContextBaseClass = "System.Data.Entity.DbContext"; // Specify what the base class is for your DbContext. For ASP.NET Identity use "IdentityDbContext<ApplicationUser>"
2020
//DefaultConstructorArgument = "EnvironmentConnectionStrings.MyDbContext"; //defaults to "Name=" + ConnectionStringName

EntityFramework.Reverse.POCO.Generator/EF.Reverse.POCO.ttinclude

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ foreach(var usingStatement in usingsAll.Distinct().OrderBy(x => x)) { #>
6969
using <#= usingStatement #>;
7070
<# } #>
7171

72-
<# if (ElementsToGenerate.HasFlag(Elements.UnitOfWork))
72+
<# if (ElementsToGenerate.HasFlag(Elements.UnitOfWork) && !string.IsNullOrWhiteSpace(DbContextInterfaceName))
7373
{
7474
fileManager.StartNewFile(DbContextInterfaceName + FileExtension);
7575
if (!GenerateSeparateFiles)
@@ -209,7 +209,7 @@ foreach(var usingStatement in usingsContext.Distinct().OrderBy(x => x)) { #>
209209
<# } #>
210210
<#if(IncludeCodeGeneratedAttribute){#> <#=CodeGeneratedAttribute#>
211211
<#}#>
212-
public <# if(MakeClassesPartial) { #>partial <# } #>class <#=DbContextName#> : <#=DbContextBaseClass#><#= (string.IsNullOrEmpty (DbContextInterfaceName)?"": ", " + DbContextInterfaceName)#>
212+
public <# if(MakeClassesPartial) { #>partial <# } #>class <#=DbContextName#> : <#=DbContextBaseClass#><#= (string.IsNullOrWhiteSpace(DbContextInterfaceName) ? "" : ", " + DbContextInterfaceName)#>
213213
{
214214
<#
215215
foreach(Table tbl in from t in tables.Where(t => !t.IsMapping && t.HasPrimaryKey).OrderBy(x => x.NameHumanCase) select t)
@@ -504,7 +504,7 @@ foreach(var usingStatement in usingsContext.Distinct().OrderBy(x => x)) { #>
504504
<# } #>
505505
<#if(IncludeCodeGeneratedAttribute){#> <#=CodeGeneratedAttribute#>
506506
<#}#>
507-
public <# if(MakeClassesPartial) { #>partial <# } #>class Fake<#=DbContextName #><#= (string.IsNullOrEmpty (DbContextInterfaceName)? "" : " : " + DbContextInterfaceName)#>
507+
public <# if(MakeClassesPartial) { #>partial <# } #>class Fake<#=DbContextName #><#= (string.IsNullOrWhiteSpace(DbContextInterfaceName) ? "" : " : " + DbContextInterfaceName)#>
508508
{
509509
<#
510510
foreach (Table tbl in from t in tables.Where(t => !t.IsMapping && t.HasPrimaryKey).OrderBy(x => x.NameHumanCase) select t)

0 commit comments

Comments
 (0)