コード例 #1
0
ファイル: GetProject.cs プロジェクト: kotorihq/kotori-core
        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);
        }
    }
コード例 #2
0
 public SimpleProjectTest(SimpleProject project)
 {
     _project = project;
 }