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
RevLine 
[618be76]1using Microsoft.EntityFrameworkCore;
[9694de9]2using iknow_api.Core.Data;
[618be76]3
[c11d3a3]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
[9694de9]12
[c0a75ab]13builder.Services.AddDbContext<AppDbContext>(options =>
14 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
15
[9694de9]16builder.Services.AddScoped<iknow_api.Repository.Interfaces.IUserRepository, iknow_api.Repository.UserRepository>();
17
[c11d3a3]18var app = builder.Build();
19
20// Configure the HTTP request pipeline.
21if (app.Environment.IsDevelopment())
22{
23 app.MapOpenApi();
24}
25
[aed1148]26builder.Services.AddDbContext<AppDbContext>(options =>
27 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
[618be76]28
29
[c11d3a3]30app.UseHttpsRedirection();
31
32app.UseAuthorization();
33
34app.MapControllers();
35
36app.Run();
Note: See TracBrowser for help on using the repository browser.