Compare commits

...

5 commits
net6 ... master

Author SHA1 Message Date
Jon Hilton
27247c7b3a
Merge pull request #7 from jonhilt/walkthrough
Fixed missing code (from .NET 6 migration)
2021-11-09 11:25:24 +00:00
Jon Hilton
d98fe0aa11 Fixed missing code (from .NET 6 migration) 2021-11-09 11:25:00 +00:00
Jon Hilton
7755c19a79
Merge pull request #6 from jonhilt/walkthrough
Added missing image
2021-11-09 10:51:27 +00:00
Jon Hilton
66d7502d01 Added missing image 2021-11-09 10:50:41 +00:00
Jon Hilton
88fcc46717
Merge pull request #5 from jonhilt/net6
Upgraded to .NET 6
2021-11-09 10:45:47 +00:00
2 changed files with 7 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,4 +1,7 @@
using Microsoft.AspNetCore.ResponseCompression;
using MediatR;
using Microsoft.EntityFrameworkCore;
using ShoppingCartStarter.Server.Data;
using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
@ -6,6 +9,8 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllersWithViews();
builder.Services.AddRazorPages();
builder.Services.AddMediatR(Assembly.GetExecutingAssembly());
builder.Services.AddDbContext<StoreContext>(options=>options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
var app = builder.Build();
@ -13,6 +18,7 @@ var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
Database.InitialiseDatabase(app, app.Environment);
}
else
{