Skip to content

Commit

Permalink
Append Entity name to classes generated due to sometimes generating m…
Browse files Browse the repository at this point in the history
…ember names cannot be same as enclosing type on instances where column names are the same as the class name
  • Loading branch information
prom3theu5 committed Jan 9, 2024
1 parent ede3c6d commit 83a8f3b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override string GenClass(TableInfo properties, string className, Gener
_sourceBuilder.AppendLine($"/// Table Name: <b>{properties.Name}</b>");
_sourceBuilder.AppendLine("/// </summary>");

_sourceBuilder.AppendLine($"public class {className}");
_sourceBuilder.AppendLine($"public class {className}Entity");
_sourceBuilder.AppendLine("{");

AddEachColumnAsProperty(properties, config);
Expand Down Expand Up @@ -111,7 +111,7 @@ private void AppendRelationships(TableInfo properties, ColumnInfo column, Genera
_sourceBuilder.AppendLine($"\t[JsonPropertyName(\"{JsonName($"Ref{column.Name}")}\")]");
}

_sourceBuilder.AppendLine($"\tpublic {relationshipRoot.CleanName}? Ref{column.Name} {{ get; set; }}");
_sourceBuilder.AppendLine($"\tpublic {relationshipRoot.CleanName}Entity? Ref{column.Name} {{ get; set; }}");
_sourceBuilder.AppendLine();
}
}
Expand Down

0 comments on commit 83a8f3b

Please sign in to comment.