fixed save failing on article with existing Images

This commit is contained in:
Mia Rose Winter 2024-03-06 13:50:20 +01:00
parent 97a73f0a32
commit f18e872325
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -315,7 +315,8 @@
Model.Categories ??= [];
context.Update(Article);
var existingImages = await context.Set<Article>().Where(a => a.Id == Article.Id)
var existingImages = await context.Set<Article>()
.IgnoreQueryFilters().Where(a => a.Id == Article.Id)
.SelectMany(a => a.Images).ToListAsync();
foreach (var image in Article.Images) {
context.Entry(image).State =