How can I change below code, to each time get 50 different random data from database?
return (from examQ in idb.Exam_Question_Int_Tbl
where examQ.Exam_
If you've the same problem, I had...
int Limit = 24;
return (from Q in Context.table
where Q.some_key == 1234
select new classDataType() {
FirstAttribute = Q.FirstCol,
SecondAttribute = Q.SecondCol,
ThirdAttribute = Q.ThirdCol
}).ToList().OrderBy(x => Guid.NewGuid()).Take(Limit).ToList();
After sql-linq it needs to be a LIST, so maybe U need changing to a list, before you're using the OrderBy-NewGuid-Method:
return (...-SQL-SELECT-LINQ-...)
.ToList() //****
.OrderBy(x => Guid.NewGuid()).Take(Limit).ToList();