public IActionResult Delete(int id) { var todelete = _repository.Get(id); if (todelete != null) { _repository.Delete(todelete); return(Helper.CheckResult(todelete, true)); } return(NotFound()); }
public async Task <CommonResponce> DeleteAppUser(long Id) { CommonResponce result = new CommonResponce { Stat = false, StatusMsg = "Error on deleting user" }; result.Stat = await _DBUserRepository.Delete(Id).ConfigureAwait(false); if (result.Stat) { result.StatusMsg = "Successfully deleted the user."; } return(result); }
public async Task <IActionResult> Remove(int id) { AppUser user = await _appUserRepository.GetById(id); if (user != null) { await _appUserRepository.Delete(user); TempData["Success"] = "The category deleted..!"; return(RedirectToAction("List")); } else { TempData["Error"] = "The category hasn't been deleted..!"; return(RedirectToAction("List")); } }
public async Task <IActionResult> DeleteUser(int id) { if (!_auth.IsSuperAdmin(User)) { return(NoContent()); } var user = await _repo.GetAppUser(id); if (user == null) { return(BadRequest($"UserId {id} could not be found")); } _repo.Delete(user); if (await _repo.SaveAll()) { return(Ok()); } return(BadRequest("Failed to delete user")); }
public void Delete(AppUser appUser) { _appUserRepository.Delete(appUser); }
public void Delete(string Id) { var user = userRepository.Get(x => x.Id == Id); userRepository.Delete(user); }