コード例 #1
0
        public IActionResult DeleteById(string id)
        {
            var ZoneId = Guid.Parse((string)id);

            if (ZoneId == null)
            {
                return(BadRequest());
            }

            var Zone = _ZoneService.GetZone(ZoneId);

            if (Zone == null)
            {
                return(NotFound());
            }

            _ZoneService.DeleteZone(ZoneId);

            return(Ok());
        }
コード例 #2
0
 public async Task <ActionResult <bool> > DeleteZone(
     [FromServices] IZoneService zoneService,
     [FromRoute] int zoneId)
 {
     return(await zoneService.DeleteZone(zoneId));
 }