Ejemplo n.º 1
0
        public async Task <ActionResult> GetTime([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var result = await _timeAppService.Get(id);

                var back = _mapper.Map <TimeEntity, TimeViewModel>(result);
                return(Ok(back));
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Ejemplo n.º 2
0
 private static bool verificarSigla(string sigla)
 {
     return(!_timeAppService.Get(x => x.sigla == sigla).Any());
 }