Skip to content

Commit

Permalink
fix controller names with split of api and mvc
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvreony committed Aug 31, 2023
1 parent 47effbc commit 0790a19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Whipstaff.AspNetCore" Version="6.1.116" />
<PackageReference Include="Whipstaff.Wpf" Version="6.1.116" />
<PackageReference Include="Whipstaff.Wpf.Mahapps" Version="6.1.116" />
<PackageReference Include="Whipstaff.AspNetCore" Version="6.1.120" />
<PackageReference Include="Whipstaff.Wpf" Version="6.1.120" />
<PackageReference Include="Whipstaff.Wpf.Mahapps" Version="6.1.120" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected override IList<string> GetUsings()
protected override string GetBaseClass(IEntityGenerationModel entityGenerationModel)
{
var entityName = entityGenerationModel.ClassName;
return $"global::Whipstaff.AspNetCore.QueryOnlyController<Queries.IList{entityName}Query, RequestDtos.List{entityName}RequestDto, ResponseDtos.List{entityName}ResponseDto, Queries.IView{entityName}Query, ResponseDtos.View{entityName}ResponseDto, LoggerMessageActions.{entityName}LoggerMessageActions>";
return $"global::Whipstaff.AspNetCore.QueryOnlyMvcController<Queries.IList{entityName}Query, RequestDtos.List{entityName}RequestDto, ResponseDtos.List{entityName}ResponseDto, Queries.IView{entityName}Query, ResponseDtos.View{entityName}ResponseDto, LoggerMessageActions.{entityName}LoggerMessageActions>";
}

protected override IEnumerable<string> GetImplementedInterfaces(IEntityGenerationModel entityGenerationModel)
Expand Down Expand Up @@ -113,7 +113,6 @@ protected override IList<Tuple<string, IList<string>>> GetClassAttributes(IEntit
{
new Tuple<string, IList<string>>("Microsoft.AspNetCore.Mvc.AutoValidateAntiforgeryToken", null),
new Tuple<string, IList<string>>("Microsoft.AspNetCore.Authorization.Authorize", null),
new Tuple<string, IList<string>>("Microsoft.AspNetCore.Mvc.Route", new[]{ $"\"{entityDeclaration.ClassName}\"" })
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override IList<string> GetUsings()
protected override string GetBaseClass(IEntityGenerationModel entityGenerationModel)
{
var entityName = entityGenerationModel.ClassName;
return $"global::Whipstaff.AspNetCore.CrudController<Queries.IList{entityName}Query, RequestDtos.List{entityName}RequestDto, ResponseDtos.List{entityName}ResponseDto, Queries.IView{entityName}Query, ResponseDtos.View{entityName}ResponseDto, Commands.IAdd{entityName}Command, RequestDtos.Add{entityName}RequestDto, ResponseDtos.Add{entityName}ResponseDto, Commands.IDelete{entityName}Command, ResponseDtos.Delete{entityName}ResponseDto, Commands.IUpdate{entityName}Command, RequestDtos.Update{entityName}RequestDto, ResponseDtos.Update{entityName}ResponseDto, LoggerMessageActions.{entityName}LoggerMessageActions>";
return $"global::Whipstaff.AspNetCore.CrudApiController<Queries.IList{entityName}Query, RequestDtos.List{entityName}RequestDto, ResponseDtos.List{entityName}ResponseDto, Queries.IView{entityName}Query, ResponseDtos.View{entityName}ResponseDto, Commands.IAdd{entityName}Command, RequestDtos.Add{entityName}RequestDto, ResponseDtos.Add{entityName}ResponseDto, Commands.IDelete{entityName}Command, ResponseDtos.Delete{entityName}ResponseDto, Commands.IUpdate{entityName}Command, RequestDtos.Update{entityName}RequestDto, ResponseDtos.Update{entityName}ResponseDto, LoggerMessageActions.{entityName}LoggerMessageActions>";
}

protected override IEnumerable<string> GetImplementedInterfaces(IEntityGenerationModel entityGenerationModel)
Expand Down Expand Up @@ -111,7 +111,6 @@ protected override IList<Tuple<string, IList<string>>> GetClassAttributes(IEntit
return new List<Tuple<string, IList<string>>>
{
new Tuple<string, IList<string>>("Microsoft.AspNetCore.Authorization.Authorize", null),
new Tuple<string, IList<string>>("Microsoft.AspNetCore.Mvc.Route", new[]{ $"\"api/{entityDeclaration.ClassName.ToLower()}\"" })
};
}

Expand Down

0 comments on commit 0790a19

Please sign in to comment.