Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DiplayName] and [InstanceName] used Title instead of Tablename in generated row.cs #1790

Merged
merged 1 commit into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Serenity.CodeGenerator.Net45/Generator/RowGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public static EntityModel GenerateModel(IDbConnection connection, string tableSc
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>();
Expand Down
1 change: 1 addition & 0 deletions Serenity.CodeGenerator.Net45/Models/EntityModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion Serenity.CodeGenerator.Net45/Views/EntityRow.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions Serenity.CodeGenerator.Net45/Views/EntityRow.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(\"");

Expand Down