Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] GeneVariantDto geneVariantDto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var geneVariantEntity = _mapper.Map <GeneVariant>(geneVariantDto);

            _context.GeneVariant.Add(geneVariantEntity);
            _context.SaveChanges();

            var entity = geneVariantEntity;

            geneVariantEntity = await _context
                                .GeneVariant
                                .Include(gv => gv.ZygosityType)
                                .Include(gv => gv.CallTypeGeneVariants)
                                .ThenInclude(geneVariantCallType => geneVariantCallType.CallType)
                                .Include(gv => gv.VariantType)
                                .SingleOrDefaultAsync(m => m.Id == entity.Id);

            var retDto = _mapper.Map <GeneVariantDto>(
                geneVariantEntity
                );

            return(Ok(retDto));
        }
 public ICollection <AnnotationGeneVariant> Resolve(GeneVariantDto source, GeneVariant destination, ICollection <AnnotationGeneVariant> destMember, ResolutionContext context)
 {
     return(source.Annotation?.Select(annotationDto => new AnnotationGeneVariant
     {
         Annotation = context.Mapper.Map <Annotation>(annotationDto),
         GeneVariant = destination
     })
            .ToList());
 }
 public ICollection <GeneVariantLiterature> Resolve(GeneVariantDto source, GeneVariant destination, ICollection <GeneVariantLiterature> destMember, ResolutionContext context)
 {
     throw new System.NotImplementedException();
 }