Пример #1
0
        public async Task <HttpResponseMessage> DeleteDefaultCity(int id)
        {
            if (await _weatherService.GetCityAsync(id) == null)
            {
                return(new HttpResponseMessage(HttpStatusCode.NotFound));
            }
            await _weatherService.DeleteCityAsync(id);

            return(new HttpResponseMessage(HttpStatusCode.OK));
        }
Пример #2
0
        public async Task <ActionResult> DeleteCity(int id)
        {
            await _weatherService.DeleteCityAsync(id);

            return(RedirectToAction("Index"));
        }