public async Task ThrowIfProjectDoesNotExists(Guid projectId) { var entity = await _projectQueries.GetByRowKeyAsync(projectId); if (entity == null || !entity.Any()) { throw new DataNotFoundException(string.Format("Project with ID {0} not found.", projectId)); } }
public async Task <IActionResult> GetAsync(Guid id) { try { var project = await _projectQueries.GetByRowKeyAsync(id); return(Ok(project)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public async Task <IActionResult> GetAsync(Guid id) { if (id == Guid.Empty) { return(BadRequest("Id can't be empty.")); } try { var task = await _tasksTableQueries.GetByRowKeyAsync(id); return(Ok(task)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }