Let me explain what I mean: I have a database that contains 4 columns, one of which is Letter, so each row has a character from 'A' to 'Z' and they are not unique, so there are several rows with "A", a few lines with "B", etc.
I want to make 26 lines (az) with all the letters, but randomize the lines that have the same letters. So I want 26 lines from A to Z, only one A, one B ..., and the lines of these letters are random. I hope you guys understand what I mean. Thanks in advance!
I thought something like:
var randomQuestions = questions.Distinct().GroupBy(q => q.Letter).Take(26).ToArray();
But I have no idea.
user6638423
source share