Skip to content

Commit 1bb39d6

Browse files
committed
Fix spacing from cuz pull request. Add in missing comments to SqlCE version.
1 parent cdac751 commit 1bb39d6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@
196196
//if (column.IsPrimaryKey && table.NameHumanCase.Equals("SomeTable", StringComparison.InvariantCultureIgnoreCase))
197197
// column.Hidden = true;
198198

199+
// Apply the "override" access modifier to a specific column.
200+
// if (column.NameHumanCase == "id")
201+
// column.OverrideModifier = true;
202+
// This will create: public override long id { get; set; }
203+
199204
// Perform Enum property type replacement
200205
var enumDefinition = EnumsDefinitions.FirstOrDefault(e =>
201206
(e.Schema.Equals(table.Schema, StringComparison.InvariantCultureIgnoreCase)) &&

EntityFramework.Reverse.POCO.Generator/Database.tt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,11 @@
217217
// Remove column from poco class as it will be inherited from a base class
218218
//if (column.IsPrimaryKey && table.NameHumanCase.Equals("SomeTable", StringComparison.InvariantCultureIgnoreCase))
219219
// column.Hidden = true;
220-
220+
221221
// Apply the "override" access modifier to a specific column.
222-
//if (column.NameHumanCase == "id")
223-
// column.OverrideModifier = true; // public override long id { get; set; }
222+
// if (column.NameHumanCase == "id")
223+
// column.OverrideModifier = true;
224+
// This will create: public override long id { get; set; }
224225

225226
// Perform Enum property type replacement
226227
var enumDefinition = EnumsDefinitions.FirstOrDefault(e =>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@
784784
public string Name; // Raw name of the column as obtained from the database
785785
public string NameHumanCase; // Name adjusted for C# output
786786
public string DisplayName; // Name used in the data annotation [Display(Name = "<DisplayName> goes here")]
787-
public bool OverrideModifier = false; //The override modifier is required
787+
public bool OverrideModifier = false; // Adds 'override' to the property declaration
788788

789789
public int DateTimePrecision;
790790
public string Default;
@@ -869,7 +869,7 @@
869869
inlineComments += ". " + ExtendedProperty;
870870
}
871871

872-
Entity = string.Format("public {0} {1} {2} {{ get; {3}set; }}{4}", (OverrideModifier ? "override" : "") , WrapIfNullable(PropertyType, this), NameHumanCase, usePrivateSetterForComputedColumns && IsComputed() ? "private " : string.Empty, inlineComments);
872+
Entity = string.Format("public {0}{1} {2} {{ get; {3}set; }}{4}", (OverrideModifier ? "override " : ""), WrapIfNullable(PropertyType, this), NameHumanCase, usePrivateSetterForComputedColumns && IsComputed() ? "private " : string.Empty, inlineComments);
873873
}
874874

875875
private string WrapIfNullable(string propType, Column col)

0 commit comments

Comments
 (0)