//public ActionResult Details(int id) //{ // return View(); //} // // GET: /Fund/Create public ActionResult Create() { SystemEntities repository = new SystemEntities(); Fund model = new Fund(); PopulateViewBag(); return View(model); }
public ActionResult Create(Fund fund) { if(ModelState.IsValid) { SystemEntities repository = new SystemEntities(); repository.Funds.Add(fund); repository.SaveChanges(); return RedirectToAction("Index", "Home"); } PopulateViewBag(); return View(fund); }