I need an ActiveRecord Collection of 2 objects that are selected at Random from the Student table where the FirstName is "John".
So, this is what I have so far
//The following gives me all the objects where FirstName is "John" -- but I need only 2 randomly selected records
StudentCollection _StudentCollection = new StudentCollection().Where(Student.FirstName, "John").Load();
//Other part I might need to use is the Query object
Query _Query = new Query():
_Query.Top = 2;
_Query.OrderBy = OrderBy.Asc("newid");
How do I combine the two so I can use the query object? Or is there is different way of doing what I am trying to achieve?
Thanks for any help in advance!