public Tuple <bool, string> DeleteRole(long id) { try { if (_userRoleRepository.Contains(x => x.RoleId == id)) { return(new Tuple <bool, string>(false, "رکورد مورد نظر استفاده شده است ، لذا قابل حذف نمی باشد!")); } _roleRepository.Delete(x => x.Id == id); _unitOfWork.SaveChanges(); return(new Tuple <bool, string>(true, "عملیات حذف انجام شد")); } catch (Exception) { return(new Tuple <bool, string>(false, "خطا در انجام عملیات")); } }