Skip to content

Commit b944365

Browse files
authored
Merge pull request #449 from jbaig/master
Allow pulling base functions from inherited interface
2 parents 810ac6a + 28dbc7f commit b944365

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

EntityFramework.Reverse.POCO.Generator/Database.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Settings.UseDataAnnotationsWithFluent = false; // If true, then non-Entity Framework-specific DataAnnotations (like [Required] and [StringLength]) will be applied to Entities even if UseDataAnnotations is false.
3636
Settings.UsePropertyInitializers = false; // Removes POCO constructor and instead uses C# 6 property initialisers to set defaults
3737
Settings.UseLazyLoading = true; // Marks all navigation properties as virtual or not, to support or disable EF Lazy Loading feature
38+
Settings.UseInheritedBaseInterfaceFunctions = false; // If true, the main DBContext interface functions will come from the DBContextInterfaceBaseClasses and not generated. If false, the functions will be generated.
3839
Settings.IncludeComments = CommentsStyle.AtEndOfField; // Adds comments to the generated code
3940
Settings.IncludeExtendedPropertyComments = CommentsStyle.InSummaryBlock; // Adds extended properties as comments to the generated code
4041
Settings.IncludeConnectionSettingComments = true; // Add comments describing connection settings used to generate file

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
public static Dictionary<string, string> StoredProcedureReturnTypes = new Dictionary<string, string>();
128128
public static Regex ColumnFilterExclude;
129129
public static bool UseLazyLoading;
130+
public static bool UseInheritedBaseInterfaceFunctions = false;
130131
public static string[] FilenameSearchOrder;
131132
public static string[] AdditionalNamespaces;
132133
public static string[] AdditionalContextInterfaceItems;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ else
9696
{ #>
9797
<#=s #>
9898
<# } #>
99+
<# if (!Settings.UseInheritedBaseInterfaceFunctions) { #>
99100
int SaveChanges();
100101
<# if (Settings.IsSupportedFrameworkVersion("4.5")) { #>
101102
System.Threading.Tasks.Task<int> SaveChangesAsync();
@@ -110,6 +111,7 @@ else
110111
System.Data.Entity.DbSet Set(System.Type entityType);
111112
System.Data.Entity.DbSet<TEntity> Set<TEntity>() where TEntity : class;
112113
string ToString();
114+
<# } #>
113115
<# if (Settings.StoredProcs.Any()) { #>
114116

115117
// Stored Procedures

0 commit comments

Comments
 (0)