public async Task <ActionResult> Delete(CountryIdModel Country) { //CountryModel model = await CountryService.Get(Country); await CountryService.Remove(Country); return(RedirectToAction("Index")); }
public async Task <CountryModel> GetCountry(CountryIdModel model) { KadabraCountry Country = await repository.FindOne(f => f.Id == model.Id); return(new CountryModel() { Id = Country.Id, ImageFlag = Country.ImageFlag, Name = Country.Name, CountryKey = Country.CountryKey }); }
public async Task <CountryModel> GetCountry(CountryIdModel countryId) { HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Country/GetCountry", countryId); if (response.IsSuccessStatusCode) { return(await response.Content.ReadAsAsync <CountryModel>()); } else { return(null); } }
public async Task <IHttpActionResult> DeleteCountry(CountryIdModel country) { if (!ModelState.IsValid) { return(InternalServerError()); } try { await services.Remove(country); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public async Task <ActionResult> Edit(CountryIdModel Country) { CountryModel model = await CountryService.GetCountry(Country); return(View(model)); }
public async Task <CountryModel> GetCountry(CountryIdModel model) { return(await services.GetCountry(model)); }
public async Task Remove(CountryIdModel country) { HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Country/DeleteCountry", country); response.EnsureSuccessStatusCode(); }
public async Task Remove(CountryIdModel Country) { await repository.Delete(t => t.Id == Country.Id); await repository.Save(); }