Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
        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);
        }