Jak zwrócić ogólną kolekcję list w C #?

Mam kilka linq do metody sql i gdy robi kwerendę, zwraca anonimowy typ.

Chcę zwrócić ten anonimowy typ z powrotem do mojej warstwy usług, aby zrobić trochę logiki i rzeczy na nim.

Nie wiem jednak, jak go zwrócić.

Myślałem, że mogę to zrobić

public List<T> thisIsAtest()
{
     return query;
}

ale dostaję ten błąd

Error   1   The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)

Więc nie jestem pewien, jakiego zespołu brakuje, a jeśli tak, to nawet tak.

Dzięki

EDYTOWAĆ

Ok, mój pierwszy problem został rozwiązany, ale teraz mam nowy problem, którego nie wiem, jak go naprawić, ponieważ nie wiem zbyt wiele o anonimowych typach.

Dostaję ten błąd

Nie można niejawnie przekonwertować typu „System.Collections.Generic.List” na „System.Collections.Generic.List”

Oto zapytanie

   DbContext.Table.Where(u => u.Table.UserId == userId && u.OutOFF != 0)
       .GroupBy(u => new { u.Table.Prefix })
       .Select(group => new { prefix = group.Key, 
                              Marks = group.Sum(item => (item.Mark * item.Weight) / item.OutOFF) })
       .ToList();

Edytuj 2

public class ReturnValue
{
   string prefix { get; set; }
   decimal? Marks { get; set; } 
}

public List<ReturnValue> MyTest(Guid userId)
{
   try
   {
       var result = dbContext.Table.Where(u => u.Table.UserId == userId && u.OutOFF != 0).GroupBy(u => new { u.Table.Prefix })
       .Select(group => new { prefix = group.Key, Marks = group.Sum(item => (item.Mark * item.Weight) / item.OutOFF) }).ToList();
       return result;
   }
   catch (SqlException)
   {
       throw;
   }

wybór ma to w sobie

Anonymous Types:

a is new{string Prefix}
b is new{ 'a prefix, decimal? marks}

questionAnswers(4)

yourAnswerToTheQuestion