public static List<string> getUsersHobbies(Int64 currentUser) { using (DBEntities dbConnection = new DBEntities()) { List<string> usersHobbies = new List<string>(); usersHobbies.Add(""); foreach (var a in dbConnection.getUsersHobbiesSP(currentUser)) { usersHobbies.Add(a); } return usersHobbies; } }
//returns the hobbies from a specific user as a stringlist public static List<string> getUsersHobbies(Int64 currentUser) { using (DBEntities dbConnection = new DBEntities()) { List<string> usersHobbies = new List<string>(); //getUsersHobbiesSP is a stored procedure mapped by the entity framework foreach (var a in dbConnection.getUsersHobbiesSP(currentUser)) { usersHobbies.Add(a); } return usersHobbies; } }