public async Task DeleteObjectAsync(RefIdentityDto input) { var objExist = _repository.FirstOrDefault(input.Id); if (objExist != null) { await _repository.DeleteAsync(objExist); } else { throw new UserFriendlyException("Item Not Found"); } }
public async Task UpdateObject(RefIdentityDto input) { var obj = _repository.FirstOrDefault(input.Id); obj.Name = input.Name; if (obj != null) { await _repository.UpdateAsync(obj); } else { throw new UserFriendlyException("Item Not Found"); } }
public async Task <ActionResult> EditIdentity(int id, RefIdentityDto collection) { try { // TODO: Add update logic here if (ModelState.IsValid) { await this.refIdentityAppService.UpdateObject(collection); return(RedirectToAction("CreateIdentityType")); } else { return(View(collection)); } } catch { return(View()); } }