public async Task <HandleResult> DetailAsync(Guid id) { if (id == Guid.Empty) { return(HandleResult.BadRequest(errorCode: "error code", errorMessage: "error message")); } var detail = await _projectRepository.DetailAsync(id); if (detail == null) { return(HandleResult.NotFound(errorCode: "error code", errorMessage: "error message")); } return(HandleResult.Ok(content: detail)); }
public async Task <HandleResult> SingleAsync(string phone) { if (string.IsNullOrWhiteSpace(phone)) { return(HandleResult.BadRequest(errorCode: "error code", errorMessage: "error message")); } var single = await _userRepository.SingleAsync(phone); if (single == null) { return(HandleResult.NotFound(errorCode: "error code", errorMessage: "error message")); } return(HandleResult.Ok(content: single)); }