public async Task <IActionResult> Delete(int cid, int pid, bool post = true)
{
var prob = Problems.SingleOrDefault(p => p.ProblemId == pid);
if (prob == null)
{
return(NotFound());
}
await Store.DeleteAsync(prob);
await HttpContext.AuditAsync("detached", $"{pid}");
await Notifier.Delete(cid, prob);
var newprobs = await Store.ListAsync(cid);
foreach (var @new in newprobs)
{
if (@new.Rank >= prob.Rank)
{
await Notifier.Update(cid, @new);
}
}
StatusMessage = $"Contest problem {prob.ShortName} has been deleted.";
return(RedirectToAction("Home", "Jury"));
}