This commit is contained in:
Hamid Reza Mohammadi 2023-07-26 17:33:09 +03:30
parent 8dcb800d34
commit bed26943bf

View File

@ -409,10 +409,19 @@ namespace RMuseum.Services.Implementation
if (res.Result != null)
{
var pdf = await context.PDFBooks.Include(p => p.Tags).Where(p => p.Id == res.Result.Id).SingleAsync();
foreach (var tag in meta)
if(pdf.Tags.Count > 0)
{
pdf.Tags.Add(tag);
//not working
foreach (var tag in meta)
{
pdf.Tags.Add(tag);
}
}
else
{
pdf.Tags = meta;
}
context.Update(pdf);
await context.SaveChangesAsync();
}