Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAsync(Guid id)
        {
            try
            {
                var project = await _projectQueries.GetByRowKeyAsync(id);

                return(Ok(project));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemplo n.º 3
0
        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));
            }
        }