public static bool AddCountryHelper(CountryModel model) { var repo = new Repository<CountryModel>(DbCollection.Country); if (repo.Gets().Any(m => m.Name.Equals(model.Name))) { return false; } repo.Insert(model); return true; }
public ActionResult AddCountry(CountryModel model) { return Json(new { result = Helper.Helper.AddCountryHelper(model), content = model }); }