NetBricks 1.0.0

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

// Install NetBricks as a Cake Tool
#tool nuget:?package=NetBricks&version=1.0.0

Why NetBricks?

I found myself using a lot of the same code and techniques from project-to-project, however, I was always copying the code and then it would deviate. I decided instead to take the best components from all my recent solutions and put the base level components into something I am calling NetBricks.

Included:

  • Config
  • AccessTokenFetcher
  • SingleLineConsoleLogger

Services

The entire solution depends on Dependency Injection. If you want everything, you should inject the following services...

services.AddHttpClient("netbricks");
services.AddSingleLineConsoleLogger();
services.AddAccessTokenFetcher();
services.AddConfig();

Config

This is a flexible and efficient configuration management solution that supports the following features:

  • values can be pulled from environment variables
  • values can be pulled from Azure App Configuration
  • values that are URLs can be resolved to secrets in Azure Key Vault
  • values can be cached
  • values can be converted to the appropriate datatype
  • defaults can be set

GetOnce()

If you need access to a value, don't need to resolve in Key Vault, and don't need to cache, use GetOnce(). You might also consider doing it as "static" since it has no requirement for an instance.

public static LogLevel LogLevel
{
    get => GetOnce("APP_LOG_LEVEL", "LOG_LEVEL").AsEnum<LogLevel>(() => LogLevel.Information);
}

More to come...

Product 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 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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetBricks:

Package Downloads
CasAuth

The Comprehensive Authentication Solution (or CasAuth) was developed to provide an opinionated way to handle user and service authentication for APIs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.9.1 47 4/29/2024
1.9.0 501 4/22/2024
1.8.0 167 4/19/2024
1.7.2 8,330 1/3/2023
1.7.1 2,681 7/8/2022
1.7.0 4,350 7/8/2022
1.6.2 2,503 6/15/2022
1.6.1 596 6/15/2022
1.6.0 3,702 2/28/2022
1.5.0 1,549 1/19/2022
1.4.1 639 1/19/2022
1.4.0 610 1/19/2022
1.3.0 1,024 9/8/2020
1.2.0 733 7/7/2020
1.1.0 478 7/7/2020
1.0.0 844 5/21/2020