Changeset 9538edc for iknow-api/Program.cs
- Timestamp:
- 10/23/25 15:32:17 (11 months ago)
- Branches:
- master
- Children:
- e49c3ed
- Parents:
- 0b16523 (diff), c7d4a59 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Stefan Saveski <76560180+stefansaveski@…> (10/23/25 15:32:17)
- git-committer:
- GitHub <noreply@…> (10/23/25 15:32:17)
- File:
-
- 1 edited
-
iknow-api/Program.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Program.cs
r0b16523 r9538edc 1 using Microsoft.EntityFrameworkCore; 2 using iknow_api.Core.Data; 3 using iknow_api.Services; 4 using iknow_api.Repositories; 5 1 6 var builder = WebApplication.CreateBuilder(args); 2 7 3 8 // Add services to the container. 9 builder.Services.AddControllers(); 10 builder.Services.AddOpenApi(); 4 11 5 builder.Services.AddControllers(); 6 // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi 7 builder.Services.AddOpenApi(); 12 // Register DbContext 13 builder.Services.AddDbContext<AppDbContext>(options => 14 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); 15 16 // Register your services 17 builder.Services.AddScoped<IAuthService, AuthService>(); 18 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation 8 19 9 20 var app = builder.Build(); … … 16 27 17 28 app.UseHttpsRedirection(); 18 19 29 app.UseAuthorization(); 20 21 30 app.MapControllers(); 22 31
Note:
See TracChangeset
for help on using the changeset viewer.
