////////////////////////////////////////////////////////////////////////////////////////////// // public List <Favorite> GetTravellerFavoritesByTravellerID(int studentID) { List <Favorite> Favorites = new List <Favorite>(); Favorite f = null; DataTable dt = null; dt = _travellerRepository.GetTravellerFavoritesByTravellerID(studentID); if (dt != null) { if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { f = new Favorite(); f.AddRowElementsToFavorite(row); Favorites.Add(f); } } else { //record that 0 rows were returned. } } return(Favorites); }