diff options
Diffstat (limited to 'Program.cs')
-rw-r--r-- | Program.cs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1,8 +1,12 @@ +using Microsoft.EntityFrameworkCore; +using LibraryAPI.Models; + var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); +builder.Services.AddDbContext<LibraryContext>(opt => opt.UseNpgsql(builder.Configuration.GetConnectionString("LibraryContext"))); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); |