Lewee.Infrastructure.AspNet.WebApi
0.7.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Lewee.Infrastructure.AspNet.WebApi --version 0.7.0
NuGet\Install-Package Lewee.Infrastructure.AspNet.WebApi -Version 0.7.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="Lewee.Infrastructure.AspNet.WebApi" Version="0.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lewee.Infrastructure.AspNet.WebApi --version 0.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lewee.Infrastructure.AspNet.WebApi, 0.7.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 Lewee.Infrastructure.AspNet.WebApi as a Cake Addin #addin nuget:?package=Lewee.Infrastructure.AspNet.WebApi&version=0.7.0 // Install Lewee.Infrastructure.AspNet.WebApi as a Cake Tool #tool nuget:?package=Lewee.Infrastructure.AspNet.WebApi&version=0.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Lewee.Infrastructure.AspNet.WebApi
This package assists with configuring and developing for ASP.Net Web API projects.
Dependencies
Features
- CORS configuration
- Controller configuration
- ApiControllerBase
- Extension methods to convert Result to
IActionResult
with appropriate HTTP status codes
services
in the code examples below are Microsoft.Extensions.DependencyInjection.ServicesCollection
.
CORS Configuration
services.ConfigureCorsDefaultPolicy("https://allowed-orgin1.com;https://allowed-origin2.com");
Controller Configuration
services.ConfigureControllers();
This configures the following:
- Controller names to use kebab-case when using the [Controller] attribute for routing naming
- Camel-casing for JSON serialization.
- Adds the problem details service
ApiControllerBase
Lewee.Infrastructure.AspNet.WebApi.ApiControllerBase
is an abstract class that has public two read-only properties
Mediator
(constructor dependency for usingMediatr
)CorrelationId
(tries to parse a GUID from a correlation ID header or returns a new GUID if one does not exist)
Result Extension Methods
TODO
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Lewee.Infrastructure.AspNet (>= 0.7.0)
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 |
---|---|---|
0.23.0 | 106 | 6/14/2024 |
0.22.0 | 103 | 6/3/2024 |
0.21.0 | 177 | 9/24/2023 |
0.20.0-alpha.1 | 60 | 9/24/2023 |
0.17.0-alpha.1 | 82 | 9/23/2023 |
0.16.0-alpha.1 | 78 | 9/23/2023 |
0.10.0 | 140 | 9/19/2023 |
0.9.0 | 142 | 9/17/2023 |
0.8.0 | 148 | 9/3/2023 |
0.7.0 | 140 | 9/3/2023 |
0.6.0 | 140 | 9/1/2023 |
0.5.3 | 159 | 8/25/2023 |
0.1.0 | 192 | 3/28/2023 |