Compare commits

..

No commits in common. "d64870bf4f1742f34b40a3dc9765782918257926" and "2c0f6f1caba1def1b9999cd87383a94eb2fe1faa" have entirely different histories.

2 changed files with 4 additions and 7 deletions

View File

@ -11,7 +11,6 @@
<base href="/" />
<link rel="preload" as="font" type="font/woff2" href="lib/inter/files/inter-latin-wght-normal.woff2" crossorigin />
<link rel="stylesheet" type="text/css" href="@Assets["lib/inter/index.css"]" data-turbo-track="reload" />
<link rel="stylesheet" type="text/css" href="@Assets["css/main.css"]" data-turbo-track="reload" />

View File

@ -243,13 +243,11 @@ public class TransactionsController : Controller
using var dbContext = dbContextFactory.CreateDbContext();
foreach (var item in transaction.Items)
{
item.Item = null;
}
// Work around EF trying to insert items by explicitly tracking them as unchanged
dbContext.Items.AttachRange(transaction.Promotions.SelectMany(promotion => promotion.Items));
dbContext.Items.AttachRange(
transaction.Items
.Select(item => item.Item!)
.Concat(transaction.Promotions.SelectMany(promotion => promotion.Items)));
dbContext.Transactions.Add(transaction);
await dbContext.SaveChangesAsync();