Abstractions.Extensions.AspNetCore.OptionsConfiguration
4.0.19
dotnet add package Abstractions.Extensions.AspNetCore.OptionsConfiguration --version 4.0.19
NuGet\Install-Package Abstractions.Extensions.AspNetCore.OptionsConfiguration -Version 4.0.19
<PackageReference Include="Abstractions.Extensions.AspNetCore.OptionsConfiguration" Version="4.0.19" />
paket add Abstractions.Extensions.AspNetCore.OptionsConfiguration --version 4.0.19
#r "nuget: Abstractions.Extensions.AspNetCore.OptionsConfiguration, 4.0.19"
// Install Abstractions.Extensions.AspNetCore.OptionsConfiguration as a Cake Addin #addin nuget:?package=Abstractions.Extensions.AspNetCore.OptionsConfiguration&version=4.0.19 // Install Abstractions.Extensions.AspNetCore.OptionsConfiguration as a Cake Tool #tool nuget:?package=Abstractions.Extensions.AspNetCore.OptionsConfiguration&version=4.0.19
Introduction
This is a small extension library meant to be used by library authors creating libraries for asp.net core. The library will ensure that required options classes are configured by the consuming application
Example
Given that you are creating the library 'MyLibrary' which requires the following options class to be configured
public class MyLibraryOptions
{
/// <summary>
/// The endpoint to use when calling the service
/// </summary>
public string Endpoint { get; set; } = "https://default.endpoint";
/// <summary>
/// Required. Your api key.
/// </summary>
[Required]
public string ApiKey { get; set; }
}
The MyLibrary might define the following extensions class:
public static class MyLibraryExtensions
{
public static IServiceCollection AddMyLibrary(this IServiceCollection services)
{
services.TryAddSingleton<IMyService, MyService>();
// This line ensures that the given options type has been configured.
// If it has not been configured, the library will automatically look for
// configuration sections named either 'MyLibrary' or 'MyLibraryOptions'
// and configure them automatically.
//
// The call will also validate data annotations on the options class.
services.AddFallbackConfiguration<MyLibraryOptions>();
// By default, the library will throw an exception if the options have not been
// configured and no options can be configured automatically.
//
// If you want the library to configure autmatically, but not throw an exception
// set required to false:
services.AddFallbackConfiguration<MyLibraryOptions>(required: false);
return services;
}
}
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 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. |
.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
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.1)
- Microsoft.Extensions.Hosting (>= 9.0.1)
- Microsoft.Extensions.Options (>= 9.0.1)
- Microsoft.Extensions.Options.DataAnnotations (>= 9.0.1)
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Abstractions.Extensions.AspNetCore.OptionsConfiguration:
Package | Downloads |
---|---|
Abstractions.Integrations.StatensVeivesen.VeichleData
This service can be added to an asp.net application in order to look up information about veichles registered in Norway. |
GitHub repositories
This package is not used by any popular GitHub repositories.