Exemple #1
0
        public async Task <IActionResult> Delete(DeleteInvestigationViewModel model)
        {
            if (ModelState.IsValid)
            {
                var investigation = await _investigationManager.FindByIdAsync(model.Id);

                if (investigation == null)
                {
                    return(NotFound(model.Id));
                }
                await _investigationManager.DeleteAsync(investigation);

                Notifier.Information($"你已成功删除了“{investigation.Name}”的意向调查记录!");
                return(RedirectToAction(nameof(List)));
            }
            return(View(model));
        }