public ActionResult Create(string title, string speaker, int categoryId, string description) { try { var talk = new Talk { Description = description, Speaker = speaker, Title = title, Category = TalksRepository.GetCategoryById(categoryId), }; TalksRepository.Add(talk); return RedirectToAction("Index"); } catch { return View(); } }
public static void Add(Talk talk) { talk.Id = talks.Last().Id + 1; talks.Add(talk); }
public static void Add(Talk talk) { talk.Id = talks.Last().Id + 1; talks.Add(talk); }