EfCore.GenericServices.AspNetCore 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EfCore.GenericServices.AspNetCore --version 1.2.0
NuGet\Install-Package EfCore.GenericServices.AspNetCore -Version 1.2.0
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="EfCore.GenericServices.AspNetCore" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EfCore.GenericServices.AspNetCore --version 1.2.0
#r "nuget: EfCore.GenericServices.AspNetCore, 1.2.0"
#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 EfCore.GenericServices.AspNetCore as a Cake Addin
#addin nuget:?package=EfCore.GenericServices.AspNetCore&version=1.2.0

// Install EfCore.GenericServices.AspNetCore as a Cake Tool
#tool nuget:?package=EfCore.GenericServices.AspNetCore&version=1.2.0

EfCore.GenericServices.AspNetCore

This library provides converters from EfCore.GenericService and EfCore.GenericBizRunner status results to into two ASP.NET Core formats.

  1. CopyErrorsToModelState which convert IStatusGeneric errors into ASP.NET Core's ModelState. Useful when working html/razor pages.
  2. Response which turns a IStatusGeneric, with optional result, into a Web API formatted return.
    • HTTP 200 (OK) with a result and the status Message string
    • HTTP 404 (Not found) if data was null
    • HTTP 400 (Bad request) with errors in the same format as Web API uses.

Response formats

  • Valid status, i.e. no errors: HTTP 200 (OK) with json result with properly message containing the Message sent back by GenericServices/GenericBizRunner
  • Status has errors: HTTP 400 (Bad request) with errors in Web API format (see below)
  • Valid status, with result:
    • Results is null: HTTP 404 (Not Found) with json result with properly message containing the Message sent back by GenericServices/GenericBizRunner
    • Results is not null: HTTP 200 (OK) with json result with properly message containing the Message, and results containing the results

Web API error format

If using Web API in ASP.NET Core 2.1 or higher the default action is to validate the input to the action and return a HTTP 400 (Bad request) with the errors send as a dictionary format in json, with the name of the property that had the error and an array of the error messages for that property. See example below:

{
    "": [
        "Global error message"
    ],
    "MyPropery": [
        "The property is required",
        "Another error on the same property"
    ]
}

The Response extension method uses that format to return IStatusGeneric so that you have a common error response format.

MIT licence

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 (1)

Showing the top 1 NuGet packages that depend on EfCore.GenericServices.AspNetCore:

Package Downloads
EntityServices

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on EfCore.GenericServices.AspNetCore:

Repository Stars
JonPSmith/AuthPermissions.AspNetCore
This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
JonPSmith/PermissionAccessControl2
Version 2 of example application to go with articles on feature and data authorization
Version Downloads Last updated
4.1.1 24,005 6/19/2020
4.1.0 5,805 3/18/2020
4.0.0 3,341 10/14/2019
4.0.0-preview001 836 2/28/2020
3.0.2 22,026 9/5/2018
3.0.1 1,503 8/31/2018
3.0.0 1,400 8/22/2018
2.0.0 1,600 8/14/2018
1.2.1 1,534 7/30/2018
1.2.0 1,333 7/25/2018
1.1.0 2,288 6/7/2018
1.0.0 1,549 4/12/2018

- New Feature: Added `Response` extension methods to turn `IGenericStatus` into standard Web API responses
     - New Feature: Now supports EfCore.GenericBizRunner, providing the same conversions as for EfCore.GenericServices