Exemplo n.º 1
0
        public IActionResult Get(string id, [FromServices] IGetProject query)
        {
            var result = _executor.ExecuteQuery(query, new ProjectDto {
                Id = id
            });

            return(Ok(result));
        }
Exemplo n.º 2
0
        public async Task <SimpleProject> GetProjectAsync(IGetProject command)
        {
            var project = await _projectRepository.GetProjectAsync(command.Instance, command.ProjectId).ConfigureAwait(false);

            if (project == null)
            {
                throw new KotoriProjectException(command.ProjectId, "Project not found.")
                      {
                          StatusCode = System.Net.HttpStatusCode.NotFound
                      }
            }
            ;

            var simpleProject = new SimpleProject(project.Name, new Uri(project.Identifier).ToKotoriProjectIdentifier());

            return(simpleProject);
        }
    }