using Microsoft.EntityFrameworkCore; using RhSolutions.Models; using RhSolutions.Api.Services; using RhSolutions.Api.Middleware; using RhSolutions.QueryModifiers; var builder = WebApplication.CreateBuilder(); string dbHost = builder.Configuration["DB_HOST"], dbPort = builder.Configuration["DB_PORT"], dbName = builder.Configuration["DB_DATABASE"], dbUser = builder.Configuration["DB_USER"], dbPassword = builder.Configuration["DB_PASSWORD"]; string connectionString = builder.Configuration["ConnectionsStrings:RhSolutionsLocal"] ?? $"Host={dbHost};Port={dbPort};Database={dbName};Username={dbUser};Password={dbPassword}"; builder.Services.AddDbContext(opts => { opts.UseNpgsql(connectionString); if (builder.Environment.IsDevelopment()) { opts.EnableSensitiveDataLogging(true); } }); builder.Services.AddScoped() .AddScoped() .AddSingleton() .AddGrpc(); builder.Services.AddControllers(); var app = builder.Build(); app.MapControllers(); app.MapGrpcService(); app.UseMiddleware(); app.Run();