docs: #365 updating poem sections when tagging category poems

This commit is contained in:
Hamid Reza Mohammadi 2023-02-18 09:26:04 +03:30
parent 36c6811f91
commit d77d1c1189

View File

@ -3397,6 +3397,12 @@ namespace RMuseum.Services.Implementation
foreach (var poem in poemList)
{
poem.Language = language;
var poemSections = await _context.GanjoorPoemSections.Where(s => s.PoemId == poem.Id && s.SectionType == PoemSectionType.WholePoem).ToListAsync();
foreach (var section in poemSections)
{
section.Language = language;
}
_context.UpdateRange(poemSections);
}
_context.UpdateRange(poemList);
await _context.SaveChangesAsync();