compiling a linq to sql query

Posted by frenchie on Stack Overflow See other posts from Stack Overflow or by frenchie
Published on 2011-01-14T17:28:58Z Indexed on 2011/01/14 17:53 UTC
Read the original article Hit count: 210

Filed under:
|

Hi,

I have queries that are built like this:

public static List<MyObjectModel> GetData (int MyParam)
{

using (DataModel MyModelDC = new DataModel())

{ var MyQuery = from....
                select MyObjectModel { ...}
}

return new List<MyObjectModel> (MyQuery)

}
}

It seems that using compiled linq-to-sql queries are about as fast as stored procedures and so the goal is to convert these queries into compiled queries. What's the syntax for this?

Thanks.

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about linq-to-sql