devdeer.Libraries.AspNetCore.RestApi
17.0.2
dotnet add package devdeer.Libraries.AspNetCore.RestApi --version 17.0.2
NuGet\Install-Package devdeer.Libraries.AspNetCore.RestApi -Version 17.0.2
<PackageReference Include="devdeer.Libraries.AspNetCore.RestApi" Version="17.0.2" />
paket add devdeer.Libraries.AspNetCore.RestApi --version 17.0.2
#r "nuget: devdeer.Libraries.AspNetCore.RestApi, 17.0.2"
// Install devdeer.Libraries.AspNetCore.RestApi as a Cake Addin #addin nuget:?package=devdeer.Libraries.AspNetCore.RestApi&version=17.0.2 // Install devdeer.Libraries.AspNetCore.RestApi as a Cake Tool #tool nuget:?package=devdeer.Libraries.AspNetCore.RestApi&version=17.0.2
devdeer.Libraries.AspNetCore.RestApi
Disclaimer
If you want to use this package you should be aware of some principles and practices we at DEVDEER use. So be aware that this is not backed by a public repository. The purpose here is to give out customers easy access to our logic. Nevertheless you are welcome to use this lib if it provides any advantages.
Summary
This package is used to provide startup logic, base types and other specific logic to ASP.NET Core API projects.
Please keep in mind that this package is not intended to be used in UI web projects!
Usage
One of the main purposes for this packages was the fact, that the initial configuration of ASP.NET APIs can be overwhelming. You need to inject dependencies and app components in the correct order. Also you often want to put configuration of those things to outside stores (appsettings.json
in our case). This package now reduces all of this to only some lines of code. You could use this as follows in the Program.cs
:
var options = new ConfigurationOptions
{
// your explicit options and callbacks
};
var builder = WebApplication.CreateBuilder(args);
builder.Host.ConfigureLogging();
builder.Services.ConfigureServices(builder.Configuration, options);
// your additional DI here
var app = builder.Build();
app.ConfigureDefaults(options);
app.Run();
Now it is crucial to unserstand that ConfigureLogging()
, ConfigureServices()
and ConfigureDefaults()
are methods coming from this package. The outcome can be controlled in 2 ways:
- Usage of
ConfigurationOptions
. You can define some of the wanted behavior using this type and pass it in. - Putting elements in your
appsettings.*.json
.
Some common app settings are:
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"TenantId": "",
"Domain": ""
},
"Cors": {
"EnableCors": true,
"AllowCredentials": false,
"AllowedHeaders": ["*"],
"AllowedMethods": ["GET", "POST"]
},
"Swagger": {
"ApiDescription": "",
"DeprecatedApiMessage": "<p><strong><span style='color:white;background-color:red'>DEPRECATED</span></strong></p>",
"Contact": {
"Name": "",
"Email": ""
},
"SupportedVersions": [{
"Major": 1,
"Minor": 0
}],
"Enable": true
}
}
Using the syntax above will automatically configure the respective services in the correct order with just two lines of code.
More Details
Swagger
We are automatically referencing Swashbuckle and configuring it if the app is running in Development
and the app config tells us to do it. By default we are using versioned APIs meaning that all controllers are expected to expose endpoints using a version.
Authentication
If the AzureAd
config option is set we automatically configure authentication to AzureAD or Azure AD B2C.
About DEVDEER
DEVDEER is a company from Magdeburg, Germany which is specialized in consulting, project management and development. We are very focussed on Microsoft Azure as a platform to run our products and solutions in the cloud. So all of our backend components usually runs in this environment and is developed using .NET. In the frontend area we are using react and a huge bunch of packages to build our UIs.
You can find us online:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Asp.Versioning.Mvc (>= 8.1.0)
- Asp.Versioning.Mvc.ApiExplorer (>= 8.1.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- AutoMapper (>= 13.0.1)
- Azure.Extensions.AspNetCore.Configuration.Secrets (>= 1.3.2)
- Azure.Identity (>= 1.13.1)
- devdeer.Libraries.Abstractions (>= 14.0.5)
- devdeer.Libraries.Abstractions.AspNetCore (>= 5.0.1)
- Microsoft.ApplicationInsights.AspNetCore (>= 2.22.0)
- Microsoft.ApplicationInsights.NLogTarget (>= 2.22.0)
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Identity.Web (>= 3.5.0)
- Microsoft.Identity.Web.MicrosoftGraph (>= 3.5.0)
- NLog (>= 5.3.4)
- NLog.Web.AspNetCore (>= 5.3.15)
- Swashbuckle.AspNetCore (>= 7.2.0)
- System.Diagnostics.DiagnosticSource (>= 9.0.0)
- System.Text.Json (>= 9.0.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 |
---|---|---|
17.0.2 | 60 | 12/24/2024 |
17.0.1 | 181 | 12/13/2024 |
17.0.0 | 181 | 12/11/2024 |
16.5.0 | 236 | 12/2/2024 |
16.4.7 | 187 | 11/1/2024 |
16.4.6 | 172 | 10/30/2024 |
16.4.5 | 87 | 10/30/2024 |
16.4.4 | 86 | 10/30/2024 |
16.4.3 | 295 | 10/27/2024 |
16.4.2 | 89 | 10/27/2024 |
16.4.1 | 88 | 10/27/2024 |
16.4.0 | 96 | 10/27/2024 |
16.3.3 | 183 | 10/14/2024 |
16.3.2 | 95 | 10/14/2024 |
16.3.1 | 144 | 10/12/2024 |
16.3.0 | 165 | 10/3/2024 |
16.2.2 | 406 | 8/23/2024 |
16.2.1 | 510 | 6/27/2024 |
16.2.0 | 111 | 6/27/2024 |
16.1.5 | 424 | 6/12/2024 |
16.1.4 | 95 | 6/12/2024 |
16.1.3 | 389 | 5/30/2024 |
16.1.2 | 107 | 5/29/2024 |
16.1.1 | 114 | 5/28/2024 |
16.1.0 | 98 | 5/28/2024 |
16.0.0 | 112 | 5/24/2024 |
15.0.1 | 143 | 5/19/2024 |
15.0.0 | 146 | 5/14/2024 |
14.4.3 | 103 | 5/14/2024 |
14.4.1 | 327 | 4/19/2024 |
14.4.0 | 128 | 4/19/2024 |
14.3.0 | 220 | 3/21/2024 |
14.2.0 | 331 | 3/11/2024 |
14.1.1 | 130 | 3/9/2024 |
14.1.0 | 120 | 3/9/2024 |
14.0.1 | 392 | 2/18/2024 |
14.0.0 | 553 | 1/20/2024 |
13.0.5 | 133 | 1/18/2024 |
13.0.4 | 366 | 12/25/2023 |
13.0.3 | 128 | 12/25/2023 |
13.0.2 | 294 | 12/11/2023 |
13.0.0 | 142 | 12/10/2023 |
12.7.5 | 313 | 11/9/2023 |
12.7.4 | 147 | 11/9/2023 |
12.7.3 | 203 | 10/29/2023 |
12.7.2 | 158 | 10/29/2023 |
12.7.1 | 254 | 9/27/2023 |
12.7.0 | 174 | 9/16/2023 |
12.6.4 | 178 | 9/14/2023 |
12.6.2 | 189 | 9/8/2023 |
12.6.1 | 175 | 9/7/2023 |
12.6.0 | 165 | 9/6/2023 |
12.5.0 | 492 | 8/15/2023 |
12.4.1 | 154 | 8/15/2023 |
12.4.0 | 169 | 8/15/2023 |
12.3.0 | 652 | 5/30/2023 |
12.2.1 | 176 | 5/29/2023 |
12.2.0 | 202 | 5/24/2023 |
12.1.0 | 195 | 5/24/2023 |
12.0.0 | 199 | 5/24/2023 |
11.0.5 | 702 | 5/23/2023 |
11.0.4 | 179 | 5/23/2023 |
11.0.3 | 173 | 5/23/2023 |
11.0.2 | 226 | 5/21/2023 |
11.0.1 | 194 | 5/21/2023 |
11.0.0 | 183 | 5/21/2023 |
10.6.0 | 199 | 5/21/2023 |
10.5.13 | 990 | 4/12/2023 |
10.5.12 | 231 | 4/12/2023 |
10.5.11 | 235 | 4/12/2023 |
10.5.10 | 474 | 4/12/2023 |
10.5.9 | 267 | 4/6/2023 |
10.5.8 | 442 | 3/14/2023 |
10.5.7 | 256 | 3/14/2023 |
10.5.6 | 663 | 3/11/2023 |
10.5.5 | 707 | 1/13/2023 |
10.5.4 | 565 | 1/10/2023 |
10.5.3 | 363 | 1/4/2023 |
10.5.2 | 335 | 1/3/2023 |
10.5.1 | 499 | 12/29/2022 |
10.5.0 | 579 | 12/29/2022 |
10.4.2 | 354 | 12/29/2022 |
10.4.0 | 681 | 12/23/2022 |
10.2.24 | 1,409 | 10/19/2022 |
10.2.23 | 450 | 10/19/2022 |
10.2.22 | 404 | 10/18/2022 |
10.2.21 | 411 | 10/17/2022 |
10.2.20 | 422 | 10/17/2022 |
10.2.19 | 440 | 10/17/2022 |
10.2.18 | 699 | 9/13/2022 |
10.2.17 | 1,243 | 9/13/2022 |
10.2.16 | 877 | 9/7/2022 |
10.2.15 | 718 | 9/6/2022 |
10.2.14 | 1,039 | 9/6/2022 |
10.2.13 | 479 | 9/6/2022 |
10.2.12 | 704 | 9/6/2022 |
10.2.11 | 696 | 9/6/2022 |
10.2.10 | 665 | 9/6/2022 |
10.2.9 | 889 | 9/5/2022 |
10.2.8 | 581 | 8/15/2022 |
10.2.7 | 518 | 8/13/2022 |
10.2.6 | 665 | 8/5/2022 |
10.2.5 | 656 | 7/19/2022 |
10.2.4 | 1,269 | 5/16/2022 |
10.2.3 | 562 | 5/16/2022 |
10.2.2 | 1,456 | 3/20/2022 |
10.2.0 | 652 | 3/20/2022 |
10.1.1 | 657 | 3/18/2022 |
10.1.0 | 621 | 3/14/2022 |
10.0.0 | 673 | 3/1/2022 |
9.0.4 | 672 | 2/28/2022 |
9.0.3 | 1,796 | 1/24/2022 |
9.0.2 | 565 | 12/22/2021 |
9.0.1 | 397 | 12/22/2021 |
9.0.0 | 395 | 12/22/2021 |
8.0.5 | 967 | 12/1/2021 |
8.0.3 | 1,044 | 8/14/2021 |
8.0.2 | 566 | 8/14/2021 |
8.0.1 | 667 | 8/14/2021 |
8.0.0 | 477 | 8/9/2021 |
7.0.13 | 1,384 | 7/12/2021 |
7.0.12 | 903 | 6/9/2021 |
7.0.11 | 1,293 | 5/1/2021 |
7.0.10 | 1,029 | 5/1/2021 |
1.4.0 | 761 | 8/25/2020 |
- .NET 6 is not supported anymore.
- Nuget updates.