Archetypical.Software.Vega.Api.Abstractions 2.0.3

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

Archetypical.Software.Vega.Api.Abstractions

archetypical-logo

Base controllers, dependency injection helpers, and common abstractions for building ASP.NET Core APIs, often used with Dapr.

Nuget

Overview

This package provides a set of tools and conventions to accelerate the development of robust, observable, and configurable web APIs. It includes:

  • Simplified application setup (CreateVegaApi, UseVegaApiDefaults).
  • Base DbContext (VegaDbContext) with multi-provider support.
  • Integrated Dapr features (Distributed Cache, Remote Configuration).
  • Configuration options (VegaApiOptions) to easily enable/disable features like OData, Swagger, OpenTelemetry, Health Checks, etc.
  • Standardized configuration loading from appsettings.json and environment variables.

Installation

Install the package via NuGet:

# .NET CLI
dotnet add package Archetypical.Software.Vega.Api.Abstractions

# Package Manager
Install-Package Archetypical.Software.Vega.Api.Abstractions

You will also likely need packages for the features you intend to use, such as:

  • Microsoft.EntityFrameworkCore.SqlServer / Npgsql.EntityFrameworkCore.PostgreSQL / etc. (for DbContext)
  • Dapr.AspNetCore (for Dapr integration)
  • Swashbuckle.AspNetCore (for Swagger, often included by default)
  • OpenTelemetry.Extensions.Hosting / OpenTelemetry.Instrumentation.AspNetCore / etc. (for OpenTelemetry)

Basic Usage (Program.cs)

using Archetypical.Software.Vega.Api.Abstractions;

var builder = VegaApiApplication.CreateVegaApi(options =>
{
    // --- Configure Core API Options --- 
    options.ServiceName = "MyMicroservice";
    options.ServiceDescription = "Provides core business logic.";

    // --- Toggle Features --- 
    // options.TurnOff.OData = true; // Example: Disable OData
    // options.TurnOff.Dapr = true; // Example: Disable Dapr (and related features)

    // --- Custom Configuration Actions --- 
    options.ODataBuilder = modelBuilder =>
    {
        // Configure your OData model here
        // modelBuilder.EntitySet<Product>("Products");
    };

    options.HealthChecks = healthChecksBuilder =>
    {
        // Add custom health checks
        // healthChecksBuilder.AddCheck<MyCustomHealthCheck>("custom_check");
    };

}, args);

// --- Register Application Services ---
// builder.Services.AddScoped<IMyService, MyService>();

// --- Register DbContext (if using VegaDbContext) ---
// Must inherit from VegaDbContext
// builder.Services.AddDbContext<MyAppContext>(); 

var app = builder.Build();

// --- Apply Vega Middleware & Initializers ---
app.UseVegaApiDefaults(); 

// --- Configure Standard ASP.NET Core Middleware ---
// app.UseHttpsRedirection(); 
app.UseAuthentication();
app.UseAuthorization();

app.MapControllers();

// Optional: Map Dapr subscription handler if using pub/sub
// app.MapSubscribeHandler(); 

app.Run();

Documentation

For detailed information on configuration and features, please refer to the documentation in the docs folder:

Key areas include:

Contributing

[Details on contributing, code of conduct, etc.]

License

[License information]

Product Compatible and additional computed target framework versions.
.NET 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
2.0.3 0 7 hours ago
2.0.2 51 a day ago
2.0.1 151 3 days ago
2.0.0 157 3 days ago
1.5.0 137 6 days ago
1.4.0 139 10 days ago
1.3.0 115 12 days ago
1.2.8 126 12 days ago
1.2.7 125 13 days ago
1.2.6 95 16 days ago
1.2.5 103 17 days ago
1.2.4 94 17 days ago
1.2.3 439 18 days ago
1.2.2 154 a month ago
1.2.1 213 a month ago
1.2.0 236 a month ago
1.1.0 163 2 months ago
1.0.6 71 2 months ago
1.0.5 197 4 months ago
1.0.4 74 4 months ago