public void Create(CountryModel model) { using (var db = new DBEntitiesProxy()) { db.Country.Add(new Country() { Name = model.Name, Code = model.Code, }); db.SaveChanges(); } }
public ActionResult Create(CountryModel model) { try { countryModel.Create(model); return RedirectToAction("Index"); } catch { return View(); } }