public async Task <ActionResult <Zone> > GetAsync(string id)
        {
            var zones = await _zoneService.GetZoneAsync(id);

            if (zones is null || !zones.Any())
            {
                return(NotFound());
            }
            return(zones.ToList().First());
        }
Beispiel #2
0
 public async Task <IActionResult> GetZone([FromRoute] Zone zone)
 {
     try
     {
         return(Ok(await _context.GetZoneAsync(zone)));
     }
     catch (ArgumentException e)
     {
         return(BadRequest(new { error = e.Message }));
     }
 }