Skip to content

Commit 39840ae

Browse files
committed
Change FullModel return type to IActionResult
1 parent 6143624 commit 39840ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Generators/Web/Codelisk.Controller.Generator/Generators/ControllerGenerator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,23 @@ ClassDeclarationSyntax baseController
127127
.AddParameter("Guid", "id")
128128
.AddAttribute($"[{Constants.HttpGetAttribute}(\"{ApiUrls.GetFull}\")]")
129129
.MakeAsync()
130-
.WithReturnTypeTask(dto.GetFullModelName())
130+
.WithReturnTypeTask("Microsoft.AspNetCore.Mvc.IActionResult")
131131
.WithBody(x =>
132132
{
133133
x.AppendLine(
134-
$"return await (_manager as I{dto.ManagerNameFromDto()}).GetFull(id);"
134+
$"return Ok(await (_manager as I{dto.ManagerNameFromDto()}).GetFull(id));"
135135
);
136136
});
137137

138138
result
139139
.AddMethod($"GetAllFull", Accessibility.Public)
140140
.MakeAsync()
141141
.AddAttribute($"[{Constants.HttpGetAttribute}(\"{ApiUrls.GetAllFull}\")]")
142-
.WithReturnTypeTaskList(dto.GetFullModelName())
142+
.WithReturnTypeTask("Microsoft.AspNetCore.Mvc.IActionResult")
143143
.WithBody(x =>
144144
{
145145
x.AppendLine(
146-
$"return await (_manager as I{dto.ManagerNameFromDto()}).GetAllFull();"
146+
$"return Ok(await (_manager as I{dto.ManagerNameFromDto()}).GetAllFull());"
147147
);
148148
});
149149
}

0 commit comments

Comments
 (0)