Hello and thanks for reading this.
I have a "question" table in my database that contains some course ID's.
This returns a list of question answers by a specific surveyid and userid.
public static List<Answers> GetAllQuestionsByCourseID(int surveyid, int userid)
{
List<Answers> list = new List<Answers>();
using (KONE_Entities db = new KONE_Entities())
{
list = db.Answers.Where(i => i.SurveyID == surveyid && i.UserID == userid).ToList();
}
return list;
}
lets say in the list of results the courseid is like this:
CourseID
1
1
1
2
2
1
3
3
3
1
How can i make it only return 1, 2 and 3 only once if they exist multiple times in the list.
The code I linked might need a rework because all i need is the CourseID right now, but specified by surve ...
Go to the complete details ...