Changes in iknow-api/Program.cs [277bd72:0b16523]
- File:
-
- 1 edited
-
iknow-api/Program.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Program.cs
r277bd72 r0b16523 1 using Microsoft.EntityFrameworkCore;2 using iknow_api.Core.Data;3 using iknow_api.Services;4 using iknow_api.Repositories;5 6 1 var builder = WebApplication.CreateBuilder(args); 7 2 8 3 // Add services to the container. 4 9 5 builder.Services.AddControllers(); 6 // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi 10 7 builder.Services.AddOpenApi(); 11 12 // Register DbContext13 builder.Services.AddDbContext<AppDbContext>(options =>14 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));15 16 // Register your services17 builder.Services.AddScoped<IAuthService, AuthService>();18 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation19 8 20 9 var app = builder.Build(); … … 27 16 28 17 app.UseHttpsRedirection(); 18 29 19 app.UseAuthorization(); 20 30 21 app.MapControllers(); 31 22
Note:
See TracChangeset
for help on using the changeset viewer.
