Hi
In my Mock_Test Table Number of Questions is There I need to select Question Randomly...
I try to fetch DO like this
using (Models.EOTAEntities dbModel = new Models.EOTAEntities())
{
if (Pssmrk.ToLower() == "nok")
{
if (Qnumber > 0)
{
var qry = from row in dbModel.Mock_Tests
where row.IsMocktest == true
select row;
int count = qry.Count(); // 1st round-trip
int index = new Random().Next(count);
Mock_Test cust = qry.Skip(index).FirstOrDefault();
//Guid r = new Guid();
//var cust = dbModel.Mock_Tests.Where(h => h.IsMocktest == true).OrderBy(h => r.()).Take(1);
return Ok(cust);
}
}
But It's Not working Please any one Help me