fixed save failing on article with existing Images
This commit is contained in:
parent
97a73f0a32
commit
f18e872325
|
@ -315,7 +315,8 @@
|
||||||
Model.Categories ??= [];
|
Model.Categories ??= [];
|
||||||
context.Update(Article);
|
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();
|
.SelectMany(a => a.Images).ToListAsync();
|
||||||
foreach (var image in Article.Images) {
|
foreach (var image in Article.Images) {
|
||||||
context.Entry(image).State =
|
context.Entry(image).State =
|
||||||
|
|
Loading…
Reference in a new issue