public ActionResult Edit(int id, opportunity opportunity) { opportunity p = op.GetById(id); p.description = opportunity.description; op.Update(p); op.Commit(); return(RedirectToAction("Index")); }
public void TestUpdate() { ConfigurationHelper.Ensure(); var service = new OpportunityService(); var item = service.GetAll().FirstOrDefault(); if (item == null) { this.TestAdd(); item = service.GetAll().FirstOrDefault(); } var itemId = item.Id; string unique = (Guid.NewGuid()).ToString(); item.Name = unique; service.Update(item); item = service.GetById(itemId); Assert.True(item.Name.Equals(unique, StringComparison.OrdinalIgnoreCase)); }