public async void DeleteApplicantTest() { await _applicantService.DeleteApplicant(1); var findResult = this._context.Applicants.SingleOrDefault(x => x.Id == 1); Assert.Null(findResult); }
public async Task <ActionResult> DeleteApplicant(BaseFormModel model) { var applicant = ApplicantService.GetApplicantById(int.Parse(model.Id)); if (applicant == null) { return(Json(new { model = "failed", modelList = "Абітурієнта не знайдено!" }, JsonRequestBehavior.AllowGet)); } var result = await ApplicantService.DeleteApplicant(applicant); return(Json(new { model = result.Successed ? "confirmed" : "failed", modelList = result.Message, type = "remove" }, JsonRequestBehavior.AllowGet)); }
protected async Task Delete_Click() { await ApplicantService.DeleteApplicant(Applicant.ID); NavigationManager.NavigateTo("/"); }