public async Task <IActionResult> GetById(int id)
 {
     try
     {
         return(Ok(await areasService.GetById(id)));
     }
     catch (FileNotFoundException ex)
     {
         return(BadRequest(ex));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Example #2
0
        public async Task <IActionResult> Get([FromRoute] int id)
        {
            var vm = await _areasService.GetById(id);

            return(Ok(vm));
        }