Пример #1
0
        public ActionResult Index(Song song)
        {
            if (!ModelState.IsValid)
            {
                var songs = Song.GetFakeData();
                return View(songs);
            }

            Song.Insert(song);
            return Redirect("~/");
        }
Пример #2
0
 public static void Insert(Song song)
 {
     fakeSongDB.Add(song);
     fakeSongDB.Sort((s1, s2) => s1.Name.CompareTo(s2.Name));
     song.Id = fakeSongDB.Count;
 }