devdeer.Libraries.AspNetCore.RestApi 16.1.5

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

// Install devdeer.Libraries.AspNetCore.RestApi as a Cake Tool
#tool nuget:?package=devdeer.Libraries.AspNetCore.RestApi&version=16.1.5

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 net6.0 is compatible.  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 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. 
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
16.2.1 36 6/27/2024
16.2.0 29 6/27/2024
16.1.5 108 6/12/2024
16.1.4 58 6/12/2024
16.1.3 281 5/30/2024
16.1.2 74 5/29/2024
16.1.1 77 5/28/2024
16.1.0 60 5/28/2024
16.0.0 79 5/24/2024
15.0.1 89 5/19/2024
15.0.0 130 5/14/2024
14.4.3 71 5/14/2024
14.4.1 286 4/19/2024
14.4.0 95 4/19/2024
14.3.0 180 3/21/2024
14.2.0 252 3/11/2024
14.1.1 93 3/9/2024
14.1.0 82 3/9/2024
14.0.1 359 2/18/2024
14.0.0 501 1/20/2024
13.0.5 89 1/18/2024
13.0.4 319 12/25/2023
13.0.3 92 12/25/2023
13.0.2 257 12/11/2023
13.0.0 110 12/10/2023
12.7.5 258 11/9/2023
12.7.4 117 11/9/2023
12.7.3 167 10/29/2023
12.7.2 116 10/29/2023
12.7.1 217 9/27/2023
12.7.0 143 9/16/2023
12.6.4 148 9/14/2023
12.6.2 160 9/8/2023
12.6.1 138 9/7/2023
12.6.0 126 9/6/2023
12.5.0 463 8/15/2023
12.4.1 117 8/15/2023
12.4.0 139 8/15/2023
12.3.0 586 5/30/2023
12.2.1 141 5/29/2023
12.2.0 174 5/24/2023
12.1.0 157 5/24/2023
12.0.0 172 5/24/2023
11.0.5 668 5/23/2023
11.0.4 147 5/23/2023
11.0.3 142 5/23/2023
11.0.2 195 5/21/2023
11.0.1 162 5/21/2023
11.0.0 157 5/21/2023
10.6.0 168 5/21/2023
10.5.13 944 4/12/2023
10.5.12 214 4/12/2023
10.5.11 201 4/12/2023
10.5.10 427 4/12/2023
10.5.9 236 4/6/2023
10.5.8 391 3/14/2023
10.5.7 231 3/14/2023
10.5.6 629 3/11/2023
10.5.5 667 1/13/2023
10.5.4 526 1/10/2023
10.5.3 327 1/4/2023
10.5.2 306 1/3/2023
10.5.1 461 12/29/2022
10.5.0 543 12/29/2022
10.4.2 325 12/29/2022
10.4.0 639 12/23/2022
10.2.24 1,361 10/19/2022
10.2.23 421 10/19/2022
10.2.22 374 10/18/2022
10.2.21 381 10/17/2022
10.2.20 392 10/17/2022
10.2.19 406 10/17/2022
10.2.18 631 9/13/2022
10.2.17 1,185 9/13/2022
10.2.16 835 9/7/2022
10.2.15 683 9/6/2022
10.2.14 993 9/6/2022
10.2.13 443 9/6/2022
10.2.12 672 9/6/2022
10.2.11 655 9/6/2022
10.2.10 629 9/6/2022
10.2.9 843 9/5/2022
10.2.8 550 8/15/2022
10.2.7 483 8/13/2022
10.2.6 629 8/5/2022
10.2.5 622 7/19/2022
10.2.4 1,239 5/16/2022
10.2.3 542 5/16/2022
10.2.2 1,424 3/20/2022
10.2.0 614 3/20/2022
10.1.1 622 3/18/2022
10.1.0 592 3/14/2022
10.0.0 642 3/1/2022
9.0.4 640 2/28/2022
9.0.3 1,768 1/24/2022
9.0.2 535 12/22/2021
9.0.1 368 12/22/2021
9.0.0 366 12/22/2021
8.0.5 931 12/1/2021
8.0.3 1,012 8/14/2021
8.0.2 536 8/14/2021
8.0.1 624 8/14/2021
8.0.0 433 8/9/2021
7.0.13 1,353 7/12/2021
7.0.12 853 6/9/2021
7.0.11 1,240 5/1/2021
7.0.10 999 5/1/2021
1.4.0 704 8/25/2020

- Nuget updates.
           - Fixing issue when using PKCE against B2C.
           - Improving startup speed on assembly load.