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