Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Program.cs

    r0b16523 r277bd72  
     1using Microsoft.EntityFrameworkCore;
     2using iknow_api.Core.Data;
     3using iknow_api.Services;
     4using iknow_api.Repositories;
     5
    16var builder = WebApplication.CreateBuilder(args);
    27
    38// Add services to the container.
     9builder.Services.AddControllers();
     10builder.Services.AddOpenApi();
    411
    5 builder.Services.AddControllers();
    6 // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
    7 builder.Services.AddOpenApi();
     12// Register DbContext
     13builder.Services.AddDbContext<AppDbContext>(options =>
     14    options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
     15
     16// Register your services
     17builder.Services.AddScoped<IAuthService, AuthService>();
     18builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation
    819
    920var app = builder.Build();
    … …  
    1627
    1728app.UseHttpsRedirection();
    18 
    1929app.UseAuthorization();
    20 
    2130app.MapControllers();
    2231
Note: See TracChangeset for help on using the changeset viewer.