public async Task <ControleDTOUpdateReturn> Put(ControleDTOUpdate controle)
        {
            try
            {
                var model  = _mapper.Map <ControleModel>(controle);
                var entity = _mapper.Map <Controle>(model);



                var result = await _repository.UpdateAsync(entity, entity.Idcontrole);

                var retornodeAlteracao = await _repository.SelectAsync(entity.Idcontrole);

                return(_mapper.Map <ControleDTOUpdateReturn>(retornodeAlteracao));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public async Task <ActionResult> Put([FromBody] ControleDTOUpdate controle)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var result = await _service.Put(controle);

                if (result != null)
                {
                    return(Ok(await _service.Get(result.Idcontrole)));
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }