add repository with mysql and entities

This commit is contained in:
Oleksandr Bezdieniezhnykh
2024-07-16 14:18:55 +03:00
parent 32c92fedf2
commit bfbfdf6658
18 changed files with 331 additions and 3 deletions
+7 -3
View File
@@ -1,13 +1,17 @@
using Azaion.Repository;
using Azaion.Repository.DTO;
using Microsoft.Extensions.Options;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.Configure<ConnectionStrings>(builder.Configuration.GetSection(nameof(ConnectionStrings)));
builder.Services.AddSingleton<IDbFactory, DbFactory>(sp => new DbFactory(sp.GetService<IOptions<ConnectionStrings>>()!.Value.FraudDb!));
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();