Remove tested media and mmc features when an mmc is deleted.

This commit is contained in:
2019-11-13 00:41:04 +00:00
parent 69cc41c3c7
commit dbf9b5bc55
5 changed files with 2313 additions and 3 deletions

View File

@@ -69,7 +69,10 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
[HttpPost, ActionName("Delete"), ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)
{
Mmc mmc = await _context.Mmc.FindAsync(id);
Mmc mmc = await _context.Mmc.FindAsync(id);
MmcFeatures feature = await _context.MmcFeatures.FirstOrDefaultAsync(f => f.Id == mmc.FeaturesId);
_context.MmcFeatures.Remove(feature);
_context.Mmc.Remove(mmc);
await _context.SaveChangesAsync();