public ActionResult Update(NikeStore nikeStore) { //NikeStore n = Json. var updateShoe = (from s in nikeEntity.NikeStores.ToList() where s.id == nikeStore.id select s).FirstOrDefault(); updateShoe.shoeType = nikeStore.shoeType; nikeEntity.SaveChanges(); return(View("Index")); }
public ActionResult Create(NikeStore nikeStore) { try { if (ModelState.IsValid) { nikeEntity.NikeStores.Add(nikeStore); nikeEntity.SaveChanges(); } return(RedirectToAction("Index")); } catch (Exception ex) { Console.WriteLine("Erro Message:{0}", ex.Message); return(RedirectToAction("Index")); } }