Compare commits
No commits in common. "d64870bf4f1742f34b40a3dc9765782918257926" and "2c0f6f1caba1def1b9999cd87383a94eb2fe1faa" have entirely different histories.
d64870bf4f
...
2c0f6f1cab
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
<base href="/" />
|
<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["lib/inter/index.css"]" data-turbo-track="reload" />
|
||||||
<link rel="stylesheet" type="text/css" href="@Assets["css/main.css"]" data-turbo-track="reload" />
|
<link rel="stylesheet" type="text/css" href="@Assets["css/main.css"]" data-turbo-track="reload" />
|
||||||
|
|
||||||
|
@ -243,13 +243,11 @@ public class TransactionsController : Controller
|
|||||||
|
|
||||||
using var dbContext = dbContextFactory.CreateDbContext();
|
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
|
// 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);
|
dbContext.Transactions.Add(transaction);
|
||||||
await dbContext.SaveChangesAsync();
|
await dbContext.SaveChangesAsync();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user