Пример #1
0
    public async Task <ActionResult> PostDelete(string clubInitials, Guid id)
    {
        try
        {
            var race = await _raceService.GetSingleRaceDetailsAsync(clubInitials, id);

            if (!await _authService.CanUserEdit(User, clubInitials) ||
                race == null)
            {
                return(Unauthorized());
            }
            await _raceService.Delete(id, await GetUserStringAsync());

            return(RedirectToAction("Index", "Admin"));
        }
        catch
        {
            return(View());
        }
    }
Пример #2
0
 public ActionResult OnPostDelete(int modelId)
 {
     _raceService.Delete(modelId);
     return(CustomRedirect(SitePages.MajorEditorRacesIndex));
 }