Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test.
$ dotnet add package Rystem.RepositoryFramework.Infrastructure.Azure.Cosmos.Sqlbuilder.Services
.AddRepositoryInCosmosSql<User, string>(
x => x.Email!,
builder.Configuration["ConnectionString:CosmosSql"],
"BigDatabase");
You found the IRepository<User, string> in DI to play with it.
With automated api, you may have the api implemented with your cosmos sql integration. You need only to add the AddApiForRepositoryFramework
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.AddApiForRepositoryFramework();