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)); }
public async Task <ActionResult> DeleteCity(int id) { await _weatherService.DeleteCityAsync(id); return(RedirectToAction("Index")); }