Skip to content

Commit 7e30752

Browse files
committed
Finished DashboardChartDataConfig
1 parent 69ef258 commit 7e30752

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Generators/Foundation/Codelisk.Foundation.Generator/Generators/ExtensionsGenerator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ IEnumerable<RecordDeclarationSyntax> baseDtos
7373
.AddParameter("this " + dtoName, dtoName.GetParameterName())
7474
.WithBody(x =>
7575
{
76+
x.If($"if({dtoName.GetParameterName()} is null) return null");
7677
x.AppendLine(
7778
$"var result = new {entityName}({dtoName.GetParameterName()});"
7879
);
@@ -102,6 +103,7 @@ IEnumerable<RecordDeclarationSyntax> baseDtos
102103
.AddParameter("this " + entityName, "entity")
103104
.WithBody(x =>
104105
{
106+
x.If($"if(entity is null) return null");
105107
x.AppendLine($"return entity as {dtoName};");
106108
})
107109
.WithReturnType(dtoName);

0 commit comments

Comments
 (0)