devdeer.Libraries.AspNetCore.RestApi 18.0.1

dotnet add package devdeer.Libraries.AspNetCore.RestApi --version 18.0.1
                    
NuGet\Install-Package devdeer.Libraries.AspNetCore.RestApi -Version 18.0.1
                    
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="devdeer.Libraries.AspNetCore.RestApi" Version="18.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="devdeer.Libraries.AspNetCore.RestApi" Version="18.0.1" />
                    
Directory.Packages.props
<PackageReference Include="devdeer.Libraries.AspNetCore.RestApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add devdeer.Libraries.AspNetCore.RestApi --version 18.0.1
                    
#r "nuget: devdeer.Libraries.AspNetCore.RestApi, 18.0.1"
                    
#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.
#addin nuget:?package=devdeer.Libraries.AspNetCore.RestApi&version=18.0.1
                    
Install devdeer.Libraries.AspNetCore.RestApi as a Cake Addin
#tool nuget:?package=devdeer.Libraries.AspNetCore.RestApi&version=18.0.1
                    
Install devdeer.Libraries.AspNetCore.RestApi as a Cake Tool

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:

  1. Usage of ConfigurationOptions. You can define some of the wanted behavior using this type and pass it in.
  2. 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 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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows 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
18.0.1 130 3/18/2025
18.0.0 172 2/14/2025
17.1.7 376 1/15/2025
17.1.6 82 1/15/2025
17.1.5 355 1/8/2025
17.1.4 160 1/6/2025
17.1.3 112 1/6/2025
17.1.2 104 1/5/2025
17.1.1 104 1/5/2025
17.1.0 125 1/4/2025
17.0.2 409 12/24/2024
17.0.1 250 12/13/2024
17.0.0 216 12/11/2024
16.5.0 522 12/2/2024
16.4.7 200 11/1/2024
16.4.6 189 10/30/2024
16.4.5 101 10/30/2024
16.4.4 97 10/30/2024
16.4.3 376 10/27/2024
16.4.2 102 10/27/2024
16.4.1 100 10/27/2024
16.4.0 111 10/27/2024
16.3.3 228 10/14/2024
16.3.2 105 10/14/2024
16.3.1 154 10/12/2024
16.3.0 181 10/3/2024
16.2.2 427 8/23/2024
16.2.1 544 6/27/2024
16.2.0 120 6/27/2024
16.1.5 432 6/12/2024
16.1.4 109 6/12/2024
16.1.3 396 5/30/2024
16.1.2 114 5/29/2024
16.1.1 121 5/28/2024
16.1.0 108 5/28/2024
16.0.0 123 5/24/2024
15.0.1 152 5/19/2024
15.0.0 154 5/14/2024
14.4.3 112 5/14/2024
14.4.1 334 4/19/2024
14.4.0 134 4/19/2024
14.3.0 227 3/21/2024
14.2.0 336 3/11/2024
14.1.1 136 3/9/2024
14.1.0 127 3/9/2024
14.0.1 402 2/18/2024
14.0.0 568 1/20/2024
13.0.5 139 1/18/2024
13.0.4 501 12/25/2023
13.0.3 134 12/25/2023
13.0.2 299 12/11/2023
13.0.0 149 12/10/2023
12.7.5 319 11/9/2023
12.7.4 152 11/9/2023
12.7.3 210 10/29/2023
12.7.2 164 10/29/2023
12.7.1 261 9/27/2023
12.7.0 180 9/16/2023
12.6.4 184 9/14/2023
12.6.2 195 9/8/2023
12.6.1 180 9/7/2023
12.6.0 172 9/6/2023
12.5.0 498 8/15/2023
12.4.1 159 8/15/2023
12.4.0 174 8/15/2023
12.3.0 691 5/30/2023
12.2.1 186 5/29/2023
12.2.0 211 5/24/2023
12.1.0 205 5/24/2023
12.0.0 209 5/24/2023
11.0.5 711 5/23/2023
11.0.4 188 5/23/2023
11.0.3 183 5/23/2023
11.0.2 238 5/21/2023
11.0.1 204 5/21/2023
11.0.0 195 5/21/2023
10.6.0 219 5/21/2023
10.5.13 1,000 4/12/2023
10.5.12 242 4/12/2023
10.5.11 245 4/12/2023
10.5.10 485 4/12/2023
10.5.9 278 4/6/2023
10.5.8 459 3/14/2023
10.5.7 267 3/14/2023
10.5.6 674 3/11/2023
10.5.5 721 1/13/2023
10.5.4 579 1/10/2023
10.5.3 377 1/4/2023
10.5.2 348 1/3/2023
10.5.1 512 12/29/2022
10.5.0 593 12/29/2022
10.4.2 368 12/29/2022
10.4.0 695 12/23/2022
10.2.24 1,427 10/19/2022
10.2.23 468 10/19/2022
10.2.22 421 10/18/2022
10.2.21 428 10/17/2022
10.2.20 438 10/17/2022
10.2.19 456 10/17/2022
10.2.18 721 9/13/2022
10.2.17 1,261 9/13/2022
10.2.16 894 9/7/2022
10.2.15 735 9/6/2022
10.2.14 1,056 9/6/2022
10.2.13 496 9/6/2022
10.2.12 722 9/6/2022
10.2.11 713 9/6/2022
10.2.10 683 9/6/2022
10.2.9 908 9/5/2022
10.2.8 599 8/15/2022
10.2.7 536 8/13/2022
10.2.6 682 8/5/2022
10.2.5 674 7/19/2022
10.2.4 1,288 5/16/2022
10.2.3 582 5/16/2022
10.2.2 1,479 3/20/2022
10.2.0 671 3/20/2022
10.1.1 678 3/18/2022
10.1.0 641 3/14/2022
10.0.0 694 3/1/2022
9.0.4 692 2/28/2022
9.0.3 1,818 1/24/2022
9.0.2 585 12/22/2021
9.0.1 418 12/22/2021
9.0.0 415 12/22/2021
8.0.5 985 12/1/2021
8.0.3 1,063 8/14/2021
8.0.2 585 8/14/2021
8.0.1 688 8/14/2021
8.0.0 495 8/9/2021
7.0.13 1,401 7/12/2021
7.0.12 923 6/9/2021
7.0.11 1,341 5/1/2021
7.0.10 1,047 5/1/2021
1.4.0 790 8/25/2020

- BREAKING: Abstractions package changes where built in.
- The complete startup process was overhauled.
- OpenApi is now built in for .NET 9 including new OpenApiConfigurationOptions.
- Fixed EnvironmentHelper.RunsInContainer()
- EnvironmentHelper now has extended support for env-var retrieval and hostname resolving.
- Nuget updates.
- Dependency updates.