SkinnyControllersCommon 2023.5.14.2055

dotnet add package SkinnyControllersCommon --version 2023.5.14.2055
NuGet\Install-Package SkinnyControllersCommon -Version 2023.5.14.2055
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SkinnyControllersCommon" Version="2023.5.14.2055" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SkinnyControllersCommon --version 2023.5.14.2055
#r "nuget: SkinnyControllersCommon, 2023.5.14.2055"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

  1. All Post
  2. Get - if not arguments, POST else
  3. Rest action

You can add your template in 2 ways: //if custom template , hte name must end in controller.txt

  1. [AutoActions(template = TemplateIndicator.CustomTemplateFile, FieldsName = new[] { "*" } ,CustomTemplateFileName = "Controllers\CustomTemplate1.controller.txt")]

  2. For creating new generic templates, please PR to https://github.com/ignatandrei/SkinnyControllersGenerator

That's all!

Usual problems:

  1. error CS0260: Missing partial modifier on declaration of type

Answer:

Did you put partial on the controller declaration ?

public partial class

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 915 5/14/2023
2021.25.6.855 4,830 12/15/2021
2021.25.6.755 596 12/15/2021
2021.25.5.1355 3,881 5/26/2021
2021.2.9.1130 813 2/9/2021
2021.1.9.2000 1,088 1/9/2021
2020.12.28.1226 887 12/28/2020
2020.12.26.938 745 12/26/2020
2020.12.24.1049 744 12/24/2020
2020.12.24.338 727 12/24/2020
2020.12.12.1133 754 12/12/2020
2020.12.3.2000 767 12/3/2020
2020.11.30.939 752 11/30/2020
2020.11.29.12 740 11/28/2020
2020.11.28.2108 831 11/28/2020
2020.11.28.1245 826 11/28/2020
2020.11.28.1003 781 11/28/2020
2020.11.23 1,256 11/24/2020