Exemple #1
0
        public async Task <ActionResult> Delete(int id)
        {
            try
            {
                Zone zone = await repository.FindZoneAsync(id);

                if (zone == null)
                {
                    return(NotFound());
                }
                await repository.DeleteZoneAsync(zone);

                return(Ok("Deleted"));
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message);
                return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }
Exemple #2
0
 public async Task <Boolean> DeleteZoneAsync(string zoneId)
 {
     return(await _zoneRepository.DeleteZoneAsync(zoneId));
 }