SkinnyControllersCommon 2023.5.14.2055
dotnet add package SkinnyControllersCommon --version 2023.5.14.2055
NuGet\Install-Package SkinnyControllersCommon -Version 2023.5.14.2055
<PackageReference Include="SkinnyControllersCommon" Version="2023.5.14.2055" />
paket add SkinnyControllersCommon --version 2023.5.14.2055
#r "nuget: SkinnyControllersCommon, 2023.5.14.2055"
// Install SkinnyControllersCommon as a Cake Addin #addin nuget:?package=SkinnyControllersCommon&version=2023.5.14.2055 // Install SkinnyControllersCommon as a Cake Tool #tool nuget:?package=SkinnyControllersCommon&version=2023.5.14.2055
SkinnyControllersGenerator
SkinnyControllers generates controller action for each field of your controller
How to install SkinnyControllers in a .NET Core 5 WebAPI / MVC application Step 1:
Install https://www.nuget.org/packages/SkinnyControllersGenerator/
Step 2:
Install https://www.nuget.org/packages/SkinnyControllersCommon/
Step 3:
Add a field to your action either via DI, either directly
[ApiController]
[Route("[controller]/[action]")]
public partial class WeatherForecastController : ControllerBase
{
private readonly RepositoryWF repository;
public WeatherForecastController(RepositoryWF repository)
{
this.repository = repository;
//or make
//this.repository=new RepositoryWF();
}
Step 4:
Add partial declaration and decorate your controller with
[AutoActions(template = TemplateIndicator.AllPost,FieldsName =new[] { "*" }, ExcludeFields =new[]{"_logger"})]
[ApiController]
[Route("[controller]/[action]")]
public partial class WeatherForecastController : ControllerBase
You can choose your template from
- All Post
- Get - if not arguments, POST else
- Rest action
You can add your template in 2 ways: //if custom template , hte name must end in controller.txt
[AutoActions(template = TemplateIndicator.CustomTemplateFile, FieldsName = new[] { "*" } ,CustomTemplateFileName = "Controllers\CustomTemplate1.controller.txt")]
For creating new generic templates, please PR to https://github.com/ignatandrei/SkinnyControllersGenerator
That's all!
Usual problems:
- error CS0260: Missing partial modifier on declaration of type
Answer:
Did you put partial on the controller declaration ?
public partial class
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- SkinnyControllersGenerator (>= 2023.5.14.2055)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2023.5.14.2055 | 5,413 | 5/14/2023 |
2021.25.6.855 | 5,313 | 12/15/2021 |
2021.25.6.755 | 622 | 12/15/2021 |
2021.25.5.1355 | 3,907 | 5/26/2021 |
2021.2.9.1130 | 838 | 2/9/2021 |
2021.1.9.2000 | 1,111 | 1/9/2021 |
2020.12.28.1226 | 910 | 12/28/2020 |
2020.12.26.938 | 774 | 12/26/2020 |
2020.12.24.1049 | 767 | 12/24/2020 |
2020.12.24.338 | 750 | 12/24/2020 |
2020.12.12.1133 | 777 | 12/12/2020 |
2020.12.3.2000 | 791 | 12/3/2020 |
2020.11.30.939 | 778 | 11/30/2020 |
2020.11.29.12 | 762 | 11/28/2020 |
2020.11.28.2108 | 856 | 11/28/2020 |
2020.11.28.1245 | 850 | 11/28/2020 |
2020.11.28.1003 | 809 | 11/28/2020 |
2020.11.23 | 1,331 | 11/24/2020 |