record-my-ruck/RecordMyRuck/Program.cs

23 lines
561 B
C#
Raw Permalink Normal View History

2024-05-17 04:30:18 +00:00
using Microsoft.EntityFrameworkCore;
using RecordMyRuck.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews();
builder.Services.AddDbContext<RecordMyRuck.Models.RecordMyRuckDbContext>(options =>
{
options.UseSqlite(builder.Configuration["ConnectionStrings:AppDb"]);
});
builder.Services.AddScoped<IRuckRepository, RuckRepository>();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.MapDefaultControllerRoute();
app.Run();