My question about System.Random command in C#.
I have a query in the MVC 4 project like:
public JsonResult GetQuestions()
{
...
var rnd = new Random();
var selectedData = data.Select(y => new
{
...,
qAnswers = ((y.qA1 != null ? "ab" : "") +
(y.qA2 != null ? "cd" : "") +
(y.qA3 != null ? "ef" : "") +
(y.qA4 != null ? "gh" : "") +
(y.qA5 != null ? "ij" : "")).OrderBy(item => rnd.Next())
});
return Json(selectedData, JsonRequestBehavior.AllowGet);
}
As a result of the query, I want to see something like:
ijcdefabgh
But the result is:
["i","a","c","d","g","h","e","f","b","j"]
Do you know to where is my mistake? or How can i fix it?