source: iknow-api/Program.cs@ aed1148

Last change on this file since aed1148 was aed1148, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

test

  • Property mode set to 100644
File size: 921 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
26builder.Services.AddDbContext<AppDbContext>(options =>
27 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
28
29
30app.UseHttpsRedirection();
31
32app.UseAuthorization();
33
34app.MapControllers();
35
36app.Run();
Note: See TracBrowser for help on using the repository browser.