In the following code, I want to retrieve all those records whose Q_ID equals to the ID.
Currently, I Select whole records instead of few.
Please help me to solve this problem.
- public ActionResult Solution(int ID)
- {
- Answers ans_obj = new Answers();
- List
dbobj= db.Ans_Table.ToList(); - List
ansobj = dbobj.Select(x => new Answers - {
- Answer = x.Answer,
- Q_ID=x.Q_ID,
- U_ID=x.U_ID
- }).ToList();
- return View();
- }
Ibrahim SiddiquePosted Nov 6, 2017, 8:31 AM