EfCore.GenericServices.AspNetCore
1.2.0
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
<PackageReference Include="EfCore.GenericServices.AspNetCore" Version="1.2.0" />
paket add EfCore.GenericServices.AspNetCore --version 1.2.0
#r "nuget: EfCore.GenericServices.AspNetCore, 1.2.0"
// 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.
CopyErrorsToModelState
which convertIStatusGeneric
errors into ASP.NET Core'sModelState
. Useful when working html/razor pages.Response
which turns aIStatusGeneric
, 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, andresults
containing the results
- Results is null: HTTP 404 (Not Found) with json result with properly
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 | 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
- EfCore.GenericBizRunner (>= 2.0.0)
- EfCore.GenericServices (>= 1.2.3)
- Microsoft.AspNetCore.Mvc (>= 2.1.1)
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 | 28,102 | 6/19/2020 |
4.1.0 | 6,178 | 3/18/2020 |
4.0.0 | 3,395 | 10/14/2019 |
4.0.0-preview001 | 875 | 2/28/2020 |
3.0.2 | 22,307 | 9/5/2018 |
3.0.1 | 1,566 | 8/31/2018 |
3.0.0 | 1,471 | 8/22/2018 |
2.0.0 | 1,644 | 8/14/2018 |
1.2.1 | 1,602 | 7/30/2018 |
1.2.0 | 1,412 | 7/25/2018 |
1.1.0 | 2,353 | 6/7/2018 |
1.0.0 | 1,604 | 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