示例#1
0
        public ActionResult CreateAnnotation(AnnotationForCreation antDto, int submissionId)
        {
            int.TryParse(HttpContext.User.Identity.Name, out var userId);
            var ant = _mapper.Map <Annotation>(antDto);

            ant.SubmissionId = submissionId;
            ant.UserId       = userId;
            _annotationRepository.Create(ant.AnnotationString, submissionId, userId);
            return(CreatedAtRoute(
                       nameof(GetAnnotation),
                       new { submissionId = submissionId, userId = userId },
                       CreateAnnotationDto(ant)));
        }
 public Try <Validation <Error, AnnotationDto> > Execute(CreateAnnotationCommand cmd)
 => ()
 => from x in ValidateCreateAnnoationCommand(cmd)
 let y = repository.Create(x)
         select y.ToAnnotationDto();