public ActionResult Add(Person newGuy) { try { newGuy.ID = Service.GetNextID(); var model = Service.AddPerson(newGuy); string view = RenderViewToString("_thePeople", model); return new JsonResponseSuccess(view); } catch (Exception ex) { return new JsonResponseError(ex.Message); } }
internal static List<Person> AddPerson(Person newGuy) { var list = Service.GetPeople(); list.Add(newGuy); return list; }