var seasonPlayer = (from SeasonPlayer in db.SeasonPlayerSet
orderby SeasonPlayer.StatisticsPlayer.Average(x => x.STP_timeplay.Ticks) descending
select SeasonPlayer).ToList();
SeasonPlayer has an ICollection of StatisticsPlayer so i want to get a average of time spent on the court ordered descending by STP_timeplay which is a typ of TimeSpan. I can't get average by STP_timeplay because it isn't a decimal so i tried get average by Ticks. It throws an exception:
The specified type member 'Ticks' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.