Changeset fc7b4b4 for iknow-api/Program.cs
- Timestamp:
- 10/22/25 22:40:03 (11 months ago)
- Branches:
- master
- Children:
- 301af3f
- Parents:
- aed1148
- File:
-
- 1 edited
-
iknow-api/Program.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Program.cs
raed1148 rfc7b4b4 1 1 using Microsoft.EntityFrameworkCore; 2 2 using iknow_api.Core.Data; 3 using FinXaccesApi.Services; 4 using FinXaccesApi.Repositories; 3 5 4 6 var builder = WebApplication.CreateBuilder(args); 5 7 6 8 // Add services to the container. 7 8 9 builder.Services.AddControllers(); 9 // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi10 10 builder.Services.AddOpenApi(); 11 11 12 12 // Register DbContext 13 13 builder.Services.AddDbContext<AppDbContext>(options => 14 14 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); 15 15 16 builder.Services.AddScoped<iknow_api.Repository.Interfaces.IUserRepository, iknow_api.Repository.UserRepository>(); 16 // Register your services 17 builder.Services.AddScoped<IAuthService, AuthService>(); 18 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation 17 19 18 20 var app = builder.Build(); … … 24 26 } 25 27 26 builder.Services.AddDbContext<AppDbContext>(options =>27 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));28 29 30 28 app.UseHttpsRedirection(); 31 32 29 app.UseAuthorization(); 33 34 30 app.MapControllers(); 35 31
Note:
See TracChangeset
for help on using the changeset viewer.
