CodeWave.Utils 1.0.7

dotnet add package CodeWave.Utils --version 1.0.7
                    
NuGet\Install-Package CodeWave.Utils -Version 1.0.7
                    
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="CodeWave.Utils" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeWave.Utils" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="CodeWave.Utils" />
                    
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 CodeWave.Utils --version 1.0.7
                    
#r "nuget: CodeWave.Utils, 1.0.7"
                    
#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=CodeWave.Utils&version=1.0.7
                    
Install CodeWave.Utils as a Cake Addin
#tool nuget:?package=CodeWave.Utils&version=1.0.7
                    
Install CodeWave.Utils as a Cake Tool

CodeWave.Utils

This is a general purpose library with nice to have gadgets for APIs

You can include all items separatedly as you wich, but the simple way of using it is by using:

builder.AddAll();

and

app.UseAll();

Make sure to add the later before the app.UseAuthorization(); line from the default template

Example:

using CodeWave.Utils;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.AddAll();

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();


var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
    app.UseDeveloperExceptionPage();
}

app.UseHttpsRedirection();

app.UseAll();

app.UseAuthorization();

app.MapControllers();


await app.RunAsync();

Configuration

All elements on the configuration are optional. Use only the ones needed.

Configuration should be set in this format:

{
  "ApiInfo": {
    "Id": "my-api",
    "Title": "My Super Api",
    "Version": "v1",
    "Contact": {
      "Name": "The Digital Team",
      "Email": "digital@gmail.com"
    }
  },
  "KeyVaultName": "my-keyvault-name",
  "SqlServer": "my-sql-server-name",
  "SqlCatalog": "my-sql-catalog",
  "ServiceBusName": "my-sb-name",
  "ServiceBusTopic": "my-sb-topic",
  "StorageAccountName": "my-storage-account-name",
  "ActiveDirectory": {
    "Authority": "https://login.microsoftonline.com/***************************/v2.0",
    "Audiences": []
  },
  "AzureActiveDirectory": {
    "Authority": "https://login.microsoftonline.com/***************************/v2.0",
    "Audiences": []
  },
  "SendGridKey: : "mysendgridkey**************",
  "Twilio" : {
    "AppId" : "my-twilio-appId",
    "Token" : "my-twilio-token",
    "FromNumber" : "+0987654321",
    "WhatsappNumber" : "+1234567890"
  }
}

General

All items in the configuration are optional. If correctly set:

  • Heltchecks are added for elements selected in the config.
  • The key vault is added as a configuration source, accessible using IConfiguration
  • The SQL is added as a configuration source, it will automaticaly create a table named configurations.
    • Connection string constructed automatically configuration["ConnectionStrings:Sql"]
    • Default OData endpoint enabled to list/add/remove configurations
  • Clients for storage are automatically added. Use BlobServiceClient, TableServiceClient, QueueServiceClient
  • Service bus is automatically added. Use ServiceBusClient, ServiceBusAdministrationClient
  • Swagger set up to use "documentation.xml", additional headers added
  • Default active directory configuration added
  • SendGrid client is automatically added. Use IEmailService
  • Twillio client for SMS and whatsapp is added. Use ISmsService and IWhatsappService
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 was computed.  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
1.0.7 104 5/8/2025
1.0.6 213 5/7/2025
1.0.5 210 5/5/2025
1.0.4 200 4/29/2025
1.0.3 227 4/29/2025
1.0.2 229 4/28/2025
1.0.1 226 4/27/2025
1.0.0 228 4/27/2025