Beispiel #1
0
        public async Task <IActionResult> GetAsync(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(BadRequest("Project name must not be empty."));
            }

            try
            {
                var project = await _projectQueries.GetByPartitionKeyAsync(name);

                return(Ok(project));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Beispiel #2
0
        public async Task <IActionResult> GetTasksByProjectId(Guid projectId)
        {
            if (projectId == Guid.Empty)
            {
                return(BadRequest("ProjectId can't be empty."));
            }

            try
            {
                var result = await _taskQueries.GetByPartitionKeyAsync(projectId.ToString());

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }