delete cat bug fix

This commit is contained in:
Hamid Reza Mohammadi 2024-11-26 10:05:19 +03:30
parent d4b6f17c32
commit 3e1bfd31df

View File

@ -3399,8 +3399,11 @@ namespace RMuseum.Services.Implementation
var corrections = await _context.GanjoorPoemCorrections.Include(c => c.VerseOrderText).Where(c => c.PoemId == id).ToListAsync();
_context.RemoveRange(corrections);
var page = await _context.GanjoorPages.Where(p => p.Id == id && p.GanjoorPageType == GanjoorPageType.PoemPage).SingleAsync();
_context.Remove(page);
var page = await _context.GanjoorPages.Where(p => p.Id == id && p.GanjoorPageType == GanjoorPageType.PoemPage).SingleOrDefaultAsync();
if(page != null)
{
_context.Remove(page);
}
_context.Remove(poem);