Example #1
0
 // public AlbumController()
 // {
 //
 /// }
 public IActionResult Index()
 {
     // 1. *************RETRIEVE ALL NAMES DETAILS ******************
     // GET: Names
     try
     {
         List <Album> albumList = new List <Album>();
         albumList = AlbumDB.GetAlbums();
         ModelState.Clear();
         return(View(albumList));
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Example #2
0
 public IActionResult ShowData()
 {
     // 1. *************RETRIEVE ALL NAMES DETAILS ******************
     // GET: Names
     try
     {
         List <Album> albumList = new List <Album>();
         //Name tmp1 = new Name() { ID = 1, FirstName = "Dan", LastName = "Test" };
         //Name tmp2 = new Name() { ID = 2, FirstName = "Tom", LastName = "Brady" };
         //myList.Add(tmp1);
         //myList.Add(tmp2);
         albumList = AlbumDB.GetAlbums();
         ModelState.Clear();
         return(View(albumList));
     }
     catch (Exception ex)
     {
         return(View());
         //throw;
     }
 }