Пример #1
0
        public async Task <IActionResult> GetAll(Guid job)
        {
            if (job == Guid.Empty)
            {
                return(BadRequest());
            }

            var fragments = await fragmentService.GetByJob(job);

            return(Ok(fragments));
        }
Пример #2
0
        public async Task <IActionResult> Get(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(BadRequest());
            }

            var job = await jobService.GetById(id);

            if (job == null)
            {
                return(NotFound());
            }

            var project = await projectService.GetById(job.ProjectId);

            var fragments = await fragmentService.GetByJob(job.Id);

            var tmp = JobToViewModel(job, project, fragments);

            return(Ok(tmp));
        }