コード例 #1
0
        public async Task <IActionResult> Post([FromBody] CandidatoViewModel value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var dto = _mapper.Map <CandidatoDto>(value);

            return(Ok(await _service.Cadastrar(dto)));
        }
コード例 #2
0
 public int Cadastrar(CandidatoInclusaoVM entity) =>
 _service.Cadastrar(MapperUtils.Map <CandidatoInclusaoVM, Candidato>(entity));