79806686

Date: 2025-11-01 16:50:40
Score: 0.5
Natty:
Report link

Try to call this, after changing the mainImageId to null, which should tell EF to do an update before trying to delete:

    dbContext.Entry(imageSeries).Property(x => x.MainImageId).IsModified = true;

Also, use RemoveRange instead of the foreach:

    dbContext.Images.RemoveRange(images);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Henrique Pombo