I am trying to do, get randomly one of "list of objects" from all lists.
I am getting NullReferenceException I also tried List couldn't make it work.
List<BL.Test.Test> Tests = BL.Test.GET.TestGroup(CategoryId);
// NullReferenceException on the line below:
int[] Groups = Tests.Select(d => d.TestGroupId).Distinct().ToArray();
Session["TestGroup"] = Tests.Select(t => t.TestGroupId = Groups[rnd.Next(Groups.Length)]);

Tests.Select(d => d.TestGroupId)returns.getaccessor forTestGroupIdthrows an exception. This is an example why it is confusing whengetaccessors throw; they should not.