public async Task <IActionResult> Delete(int id) { string fullLink = $"{baseUri}/ClassGroup"; string classgroupById = fullLink + "/" + id; await WebApiService.DeleteCallApi <ClassGroup>(classgroupById); return(RedirectToAction("Index", "Classgroup")); }
public async Task <IActionResult> Delete(int id) { string fullLink = $"{baseUri}/SchoolUserCategory"; string schoolUserCategoryById = fullLink + "/" + id; await WebApiService.DeleteCallApi <SchoolUserCategory>(schoolUserCategoryById); return(RedirectToAction("Index", "UserCategory")); }
public async Task <IActionResult> Delete(Guid id) { string fullLink = $"{baseUri}/SchoolUser"; string userById = fullLink + "/" + id; var schoolUser = WebApiService.GetApiResult <SchoolUser>(userById); string identityId = schoolUser.IdentityReference; var identityUser = await _user.FindByIdAsync(identityId); await _user.DeleteAsync(identityUser); await WebApiService.DeleteCallApi <SchoolUser>(userById); return(RedirectToAction("Overview", "User")); }
public async Task <IActionResult> Delete(int id) { var questionToDeleteLink = $"{baseUri}/Question/{id}"; var questionToDelete = WebApiService.GetApiResult <Question>(questionToDeleteLink); var feedBackOne = questionToDelete.Feedback.ElementAt(0); var feedBackOneLink = $"{baseUri}/Feedback/{feedBackOne.Id}"; var deletedFeedBackOne = await WebApiService.DeleteCallApi <Feedback>(feedBackOneLink); var feedBackTwo = questionToDelete.Feedback.ElementAt(1); var feedBackTwoLink = $"{baseUri}/Feedback/{feedBackTwo.Id}"; var deletedFeedBackTwo = await WebApiService.DeleteCallApi <Feedback>(feedBackTwoLink); var questionLink = $"{baseUri}/Question/{id}"; var deletedQuestion = await WebApiService.DeleteCallApi <Question>(questionLink); var answerLink = $"{baseUri}/Answer/{deletedQuestion.AnswerId}"; var deletedAnswer = await WebApiService.DeleteCallApi <Answer>(answerLink); return(RedirectToAction(nameof(Index))); }