AutoEndpoints.Cosmos

AutoEndpoints is a ASP.NET Core based framework for rapid WebAPI development


Keywords
ASP.NET, AspNetCore, MinimalAPIs, WebAPI, asp-net, asp-net-core, database, minimap-api
License
MIT
Install
Install-Package AutoEndpoints.Cosmos -Version 1.1.0

Documentation

Overview

AutoEndpoints is a WebAPI framework for automatic endpoint building for database entities

.github/workflows/build.yml

AutoEndpoints.Redis
AutoEndpoints.Cosmos
AutoEndpoints.Dapper.SqlServer

Supported databases:

  1. Redis
  2. Microsoft Azure Cosmos DB
  3. Microsoft SQL Server

Supported platforms:

  • .NET 8+

Example

Program.cs:

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRedisEndpoints("localhost:6379");

var app = builder.Build();

app.MapRedisGetEndpoint<RedisTestModel>("{id}")
    .KeyFromRoute("id")
    .Build();

app.MapRedisPostEndpoint<RedisTestModel>("{id}")
    .KeyFromRoute("id")
    .Build();

await app.RunAsync();

Nuget packages links

How to use

Basic steps:

  1. Create new web api project
  2. Added nuget package for target database
Database Nuget package
Redis AutoEndpoints.Redis
Microsoft Azure Cosmos DB AutoEndpoints.Cosmos
Microsoft SQL Server with Dapper AutoEndpoints.Dapper.SqlServer
  1. Register database provider in services
builder.Services.AddRedisEndpoints("localhost:6379");
  1. Map endpoints
app.MapRedisGetEndpoint<RedisTestModel>("{id}")
    .KeyFromRoute("id")
    .Build();

Done