https://github.com/romfos/autoendpoints
AutoEndpoints is a WebAPI framework for automatic endpoint building for database entities
https://github.com/romfos/autoendpoints
asp-net asp-net-core database minimap-api webapi
Last synced: over 1 year ago
JSON representation
AutoEndpoints is a WebAPI framework for automatic endpoint building for database entities
- Host: GitHub
- URL: https://github.com/romfos/autoendpoints
- Owner: Romfos
- License: mit
- Created: 2023-12-03T12:34:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-04T09:46:53.000Z (over 1 year ago)
- Last Synced: 2025-02-04T10:29:55.188Z (over 1 year ago)
- Topics: asp-net, asp-net-core, database, minimap-api, webapi
- Language: C#
- Homepage:
- Size: 122 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
AutoEndpoints is a WebAPI framework for automatic endpoint building for database entities
[](https://github.com/Romfos/AutoEndpoints/actions/workflows/build.yml)
[](https://www.nuget.org/packages/AutoEndpoints.Redis)\
[](https://www.nuget.org/packages/AutoEndpoints.Cosmos)\
[](https://www.nuget.org/packages/AutoEndpoints.Dapper.SqlServer)
Supported databases:
1) Redis
2) Microsoft Azure Cosmos DB
3) Microsoft SQL Server
Supported platforms:
- .NET 8+
# Example
Program.cs:
```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRedisEndpoints("localhost:6379");
var app = builder.Build();
app.MapRedisGetEndpoint("{id}")
.KeyFromRoute("id")
.Build();
app.MapRedisPostEndpoint("{id}")
.KeyFromRoute("id")
.Build();
await app.RunAsync();
```
# Nuget packages links
- https://www.nuget.org/packages/AutoEndpoints.Redis
- https://www.nuget.org/packages/AutoEndpoints.Cosmos
- https://www.nuget.org/packages/AutoEndpoints.Dapper.SqlServer
# How to use
Basic steps:
1) Create new web api project
2) Added nuget package for target database
| Database | Nuget package |
|----------------------------------|-------------------------------------------------------------------------------------------------|
| Redis | [AutoEndpoints.Redis](https://www.nuget.org/packages/AutoEndpoints.Redis) |
| Microsoft Azure Cosmos DB | [AutoEndpoints.Cosmos](https://www.nuget.org/packages/AutoEndpoints.Cosmos) |
| Microsoft SQL Server with Dapper | [AutoEndpoints.Dapper.SqlServer](https://www.nuget.org/packages/AutoEndpoints.Dapper.SqlServer) |
3) Register database provider in services
```
builder.Services.AddRedisEndpoints("localhost:6379");
```
4) Map endpoints
```
app.MapRedisGetEndpoint("{id}")
.KeyFromRoute("id")
.Build();
```
Done