Initium 0.2.14
dotnet add package Initium --version 0.2.14
NuGet\Install-Package Initium -Version 0.2.14
<PackageReference Include="Initium" Version="0.2.14" />
<PackageVersion Include="Initium" Version="0.2.14" />
<PackageReference Include="Initium" />
paket add Initium --version 0.2.14
#r "nuget: Initium, 0.2.14"
#:package Initium@0.2.14
#addin nuget:?package=Initium&version=0.2.14
#tool nuget:?package=Initium&version=0.2.14
<p align="center"> <img src="https://raw.githubusercontent.com/imclint21/Initium/master/src/Initium/logo.png" height="100" alt="Initium" /> </p>
<h3 align="center">Initium</h3>
<p align="center"> Service Core Foundation for .NET API development. </p>
<p align="center"> <a href="https://github.com/imclint21/Initium/actions/workflows/publish.yml"><img src="https://github.com/imclint21/Initium/actions/workflows/publish.yml/badge.svg?branch=master" /></a> <a href="https://www.nuget.org/packages/Initium/"><img src="https://img.shields.io/nuget/v/Initium" /></a> <img src="https://img.shields.io/badge/.NET-8.0%20LTS-blue" /> <img src="https://img.shields.io/badge/license-MIT-lightgrey.svg" /> </p>
Introduction
Initium is a library for simplifying .NET API development, offering standardized service operations, flexible routing, and seamless chaining of service results for cleaner and more maintainable code.
- Streamlined API Controllers: Simplifies response handling with attributes like
[ApiResponse], providing clear and consistent HTTP status documentation. - Centralized Result Management:
ServiceResultenables clear success or failure status, making error handling and conditional logic seamless. - Exception Handling Made Easy:
ApiExceptionprovides a straightforward way to handle specific HTTP error codes, improving code clarity. - Result Chaining: Methods return
ServiceResultor typed results, allowing for intuitive chaining and cleaner service logic. - Enhanced Maintainability: Standardized patterns reduce boilerplate code, making APIs easier to build, understand, and maintain.
Getting Started
To get started with Initium, just add the package using NuGet:
dotnet add package Initium
How does it Work?
Here's how to create a controller :
public class CoffeeController(CoffeeService service) : ApiController
{
[HttpPost]
[ApiResponse(200, "Coffee prepared successfully.")]
[ApiResponse(400, "An error occurred during the preparation process.")]
public ActionResult PrepareCoffee() => service.PrepareCoffee();
}
And here's how to create an action in a service, each function returns a ServiceResult, and can be chained.
public class CoffeeService
{
public ServiceResult DoSomething()
{
return ServiceResult.Error("Something happened!", HttpStatusCode.Conflict);
}
public ServiceResult PrepareCoffee()
{
var doSomethingResult = DoSomething();
if (doSomethingResult == false) return doSomethingResult;
return ServiceResult.Ok("The coffee is now DONE!");
}
}
Documentation
See the docs/ folder for detailed documentation:
Contribute to Initium
See CONTRIBUTING.md for best practices and instructions on setting up your development environment to work on Initium.
| Product | Versions 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FluentValidation (>= 12.0.0)
- Tapper.Attributes (>= 1.13.1)
- YamlDotNet (>= 16.3.0)
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 |
|---|---|---|
| 0.2.14 | 80 | 3/25/2026 |
| 0.2.13 | 66 | 3/25/2026 |
| 0.2.12 | 75 | 3/25/2026 |
| 0.2.11 | 77 | 3/25/2026 |
| 0.2.10 | 74 | 3/25/2026 |
| 0.2.9 | 645 | 9/17/2025 |
| 0.2.8 | 268 | 9/1/2025 |
| 0.2.7 | 209 | 9/1/2025 |
| 0.2.6 | 202 | 8/9/2025 |
| 0.2.5 | 684 | 7/22/2025 |
| 0.2.4 | 535 | 7/21/2025 |
| 0.1.26 | 461 | 1/10/2025 |
| 0.1.23 | 185 | 1/5/2025 |
| 0.1.22 | 207 | 1/5/2025 |
| 0.1.21 | 222 | 1/1/2025 |
| 0.1.20 | 236 | 1/1/2025 |