Skip to content

Commit 3e53604

Browse files
committed
fix format and UT
1 parent 426f4c3 commit 3e53604

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

generators/entity-client/templates/blazor/src/Project.Client/Models/Model.cs.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace <%= namespace %>.Client.Models
6767
if(otherEntityNamePascalized === 'User') { _%>
6868
public string UserId { get; set; }
6969
<%_ } else { _%>
70-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
70+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
7171
<%_ }
7272
}
7373
if(relationshipType === 'one-to-many') { _%>
@@ -79,7 +79,7 @@ namespace <%= namespace %>.Client.Models
7979
if(otherEntityNamePascalized === 'User') { _%>
8080
public string UserId { get; set; }
8181
<%_ } else { _%>
82-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
82+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
8383
<%_ }
8484
} else if (relationshipType === 'many-to-many') { _%>
8585
public IList<<%= asModel(otherEntityNamePascalized) %>> <%= relationshipFieldNamePascalizedPlural %> { get; set; } = new List<<%= asModel(otherEntityNamePascalized) %>>();

generators/entity-client/templates/blazor/src/Project.Client/Pages/Entities/Entity/EntityUpdate.razor.cs.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace <%= namespace %>.Client.Pages.Entities.<%= entityClassName %>
7070
<%_ } else { _%>
7171
public IEnumerable<<%= primaryKeyType %>> <%= relation.otherEntityNamePascalized %>Ids { get; set; } = new List<<%= primaryKeyType %>>();
7272
73-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relation.otherEntityNamePascalized %>Id { get; set; }
73+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relation.otherEntityNamePascalized %>Id { get; set; }
7474
7575
<%_ } _%>
7676
<%_ } else if ((relation.relationshipType === 'many-to-many' || relation.relationshipType === 'one-to-many') && relation.ownerSide === true ) { _%>

generators/entity-client/templates/blazor/test/Project.Client.Test/Pages/Entities/Entity/EntityDetailTest.cs.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace <%= namespace %>.Client.Test.Pages.Entities.<%= entityClassName %>
6868
//Arrange
6969
var <%= lowerCasedEntityClass %> = _fixture.Create<<%= asModel(entityClassName) %>>();
7070
_<%= lowerCasedEntityClass %>Service.Setup(service => service.Get(It.IsAny<string>())).Returns(Task.FromResult(<%= lowerCasedEntityClass %>));
71-
var <%= lowerCasedEntityClass %>Detail = RenderComponent<<%= entityClassName %>Detail>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { %> 1 <%_ } else { _%> "1" <%_ } _%>));
71+
var <%= lowerCasedEntityClass %>Detail = RenderComponent<<%= entityClassName %>Detail>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { _%> 1L <%_ } else { _%> "1" <%_ } _%>));
7272

7373
// Act
7474
var title = <%= lowerCasedEntityClass %>Detail.Find("h2");

generators/entity-client/templates/blazor/test/Project.Client.Test/Pages/Entities/Entity/EntityUpdateTest.cs.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ namespace <%= namespace %>.Client.Test.Pages.Entities.<%= entityClassName %>
109109
}); _%>
110110

111111
var <%= entityVariableName %>ToUpdate = _fixture.Create<<%= asModel(entityClassName) %>>();
112-
<%= entityVariableName %>ToUpdate.Id = <% if(primaryKeyType !== 'string') { %> 1 <%_ } else { _%> "1" <%_ } _%>;
112+
<%= entityVariableName %>ToUpdate.Id = <% if(primaryKeyType !== 'string') { _%> 1 <%_ } else { _%> "1" <%_ } _%>;
113113

114114
_<%= entityVariableName %>Service.Setup(service => service.Get(It.IsAny<string>())).Returns(Task.FromResult(<%= entityVariableName %>ToUpdate));
115115

116-
var update<%= entityClassName %>Page = RenderComponent<<%= namespace %>.Client.Pages.Entities.<%= entityClassName %>.<%= entityClassName %>Update>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { %> 1 <%_ } else { _%> "1" <%_ } _%>));
116+
var update<%= entityClassName %>Page = RenderComponent<<%= namespace %>.Client.Pages.Entities.<%= entityClassName %>.<%= entityClassName %>Update>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { _%> 1L <%_ } else { _%> "1" <%_ } _%>));
117117

118118
// Act
119119
var <%= entityVariableName %>Form = update<%= entityClassName %>Page.Find("form");
@@ -137,7 +137,7 @@ namespace <%= namespace %>.Client.Test.Pages.Entities.<%= entityClassName %>
137137
<%_ }
138138
}); _%>
139139

140-
var update<%= entityClassName %>Page = RenderComponent<<%= namespace %>.Client.Pages.Entities.<%= entityClassName %>.<%= entityClassName %>Update>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { %> 0 <%_ } else { _%> null <%_ } _%>));
140+
var update<%= entityClassName %>Page = RenderComponent<<%= namespace %>.Client.Pages.Entities.<%= entityClassName %>.<%= entityClassName %>Update>(ComponentParameter.CreateParameter("Id", <% if(primaryKeyType !== 'string') { _%> 0L <%_ } else { _%> null <%_ } _%>));
141141

142142
// Act
143143
var <%= entityVariableName %>Form = update<%= entityClassName %>Page.Find("form");

generators/entity-server/templates/dotnetcore/src/Project.Domain/Entities/Entity.cs.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace <%= namespace %>.Domain
7575
if(otherEntityNamePascalized === 'User') { _%>
7676
public string UserId { get; set; }
7777
<%_ } else { _%>
78-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
78+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
7979
<%_ } _%>
8080
public <%= otherEntityNamePascalized %> <%= relationshipFieldNamePascalized %> { get; set; }
8181
<%_ }
@@ -88,7 +88,7 @@ namespace <%= namespace %>.Domain
8888
if(otherEntityNamePascalized === 'User') { _%>
8989
public string UserId { get; set; }
9090
<%_ } else { _%>
91-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
91+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
9292
<%_ } _%>
9393
public <%= otherEntityNamePascalized %> <%= relationshipFieldNamePascalized %> { get; set; }
9494
<% } else if (relationshipType === 'many-to-many') {

generators/entity-server/templates/dotnetcore/src/Project.Dto/Dto.cs.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace <%= namespace %>.Dto
7777
if(otherEntityNamePascalized === 'User') { _%>
7878
public string UserId { get; set; }
7979
<%_ } else { _%>
80-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
80+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
8181
<%_ }
8282
}
8383
if(relationshipType === 'one-to-many') { _%>
@@ -89,7 +89,7 @@ namespace <%= namespace %>.Dto
8989
if(otherEntityNamePascalized === 'User') { _%>
9090
public string UserId { get; set; }
9191
<%_ } else { _%>
92-
public <%= primaryKeyType %> <% if(primaryKeyType !== 'string') { _%>?<%_ } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
92+
public <%= primaryKeyType _%> <%_ if(primaryKeyType !== 'string') { _%>? <% } _%> <%= relationshipFieldNamePascalized %>Id { get; set; }
9393
<%_ }
9494
} else if (relationshipType === 'many-to-many') {
9595
const ownerSide = relationships[idx].ownerSide; _%>

0 commit comments

Comments
 (0)