Permalink
Browse files

[DiplayName] and [InstanceName] used Title instead of Tablename in ge…

…nerated row.cs (#1790)
  • Loading branch information...
1 parent 8c1d78a commit 86eeb10367f16ea5ac34a4e31d9f9e7360c101bb @dfaruque dfaruque committed with Jan 12, 2017
@@ -128,6 +128,7 @@ private static EntityField ToEntityField(SqlSchemaInfo.FieldInfo fieldInfo, int
var className = entityClass ?? ClassNameFromTableName(table);
model.ClassName = className;
model.RowClassName = className + "Row";
+ model.Title = Inflector.Inflector.Titleize(className);
model.Tablename = table;
model.Fields = new List<EntityField>();
model.Joins = new List<EntityJoin>();
@@ -12,6 +12,7 @@ public class EntityModel
public string RowClassName { get; set; }
public string Schema { get; set; }
public string Tablename { get; set; }
+ public string Title { get; set; }
public string Identity { get; set; }
public string RowBaseClass { get; set; }
public List<EntityField> RowBaseFields { get; set; }
@@ -22,7 +22,7 @@ namespace @(Model.RootNamespace)@(dotModule).Entities
using System.ComponentModel;
using System.IO;
- [ConnectionKey("@Model.ConnectionKey"), DisplayName("@Model.Tablename"), InstanceName("@Model.Tablename"), TwoLevelCached]
+ [ConnectionKey("@Model.ConnectionKey"), DisplayName("@Model.Title"), InstanceName("@Model.Title"), TwoLevelCached]
[ReadPermission("@Model.Permission")]
[ModifyPermission("@Model.Permission")]
public sealed class @Model.RowClassName : @Model.RowBaseClass, IIdRow@(Model.IsLookup ? ", IDbLookupRow" : "")@(Model.NameField == null ? "" : ", INameRow")
@@ -61,12 +61,12 @@ public override void Execute()
WriteLiteral("\"), DisplayName(\"");
- Write(Model.Tablename);
+ Write(Model.Title);
WriteLiteral("\"), InstanceName(\"");
- Write(Model.Tablename);
+ Write(Model.Title);
WriteLiteral("\"), TwoLevelCached]\r\n [ReadPermission(\"");
@@ -25,7 +25,7 @@ namespace @(Model.RootNamespace)@(dotModule).Entities
using System.ComponentModel;
using System.IO;
- [ConnectionKey("@Model.ConnectionKey"), DisplayName("@Model.Tablename"), InstanceName("@Model.Tablename"), TwoLevelCached]
+ [ConnectionKey("@Model.ConnectionKey"), DisplayName("@Model.Title"), InstanceName("@Model.Title"), TwoLevelCached]
[ReadPermission("@Model.Module:@Model.Tablename:Read")]
[InsertPermission("@Model.Module:@Model.Tablename:Insert")]
[UpdatePermission("@Model.Module:@Model.Tablename:Update")]
@@ -64,12 +64,12 @@ public override void Execute()
WriteLiteral("\"), DisplayName(\"");
- Write(Model.Tablename);
+ Write(Model.Title);
WriteLiteral("\"), InstanceName(\"");
- Write(Model.Tablename);
+ Write(Model.Title);
WriteLiteral("\"), TwoLevelCached]\n [ReadPermission(\"");

0 comments on commit 86eeb10

Please sign in to comment.