0

Hi I have a Linq Like this

from item in db.SportsActivities where item.GeoSportsId == SportsId select item.SportsTeam)
                        .OrderBy(it => it.Description)
                        .ToList()
                        .ConvertAll<SportsTeam>(ConvertFromDAL)

This query is quite inefficient, I'm looking for a way to optimize it with CompiledQuery. I tried to use this by compiled query though I could not find a way to figure how to arrange and use this with CompiledQuery. I'm quite new with LINQ.

Richard
  • 106,783
  • 21
  • 203
  • 265
not 0x12
  • 19,360
  • 22
  • 67
  • 133
  • Is this Linq2Sql or Entity Framework? – Erik Philips May 22 '14 at 07:32
  • possible duplicate of [Converting Linq2SQL simple queries to CompiledQueries to increase app performance](http://stackoverflow.com/questions/10135031/converting-linq2sql-simple-queries-to-compiledqueries-to-increase-app-performanc) – Erik Philips May 22 '14 at 07:34
  • @ErikPhilips, hi this is not about converting linq to sql simple queries – not 0x12 May 22 '14 at 07:35
  • No idea what Convert all is, but not sure why you'd want to call `ToList` before it – Sayse May 22 '14 at 07:38

0 Answers0