source: iknow-api/Program.cs@ 9a57e89

Last change on this file since 9a57e89 was 9a57e89, checked in by imbrsk <boris696boris@…>, 11 months ago

Refactor user management: update models, repositories, and services; remove obsolete files

  • Property mode set to 100644
File size: 778 bytes
Line 
1using Microsoft.EntityFrameworkCore;
2using iknow_api.Core.Data;
3
4var builder = WebApplication.CreateBuilder(args);
5
6// Add services to the container.
7
8builder.Services.AddControllers();
9// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
10builder.Services.AddOpenApi();
11
12
13builder.Services.AddDbContext<AppDbContext>(options =>
14 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
15
16builder.Services.AddScoped<iknow_api.Repository.Interfaces.IUserRepository, iknow_api.Repository.UserRepository>();
17
18var app = builder.Build();
19
20// Configure the HTTP request pipeline.
21if (app.Environment.IsDevelopment())
22{
23 app.MapOpenApi();
24}
25
26
27
28app.UseHttpsRedirection();
29
30app.UseAuthorization();
31
32app.MapControllers();
33
34app.Run();
Note: See TracBrowser for help on using the repository browser.