Questions tagged [compiled-query]

CompiledQuery is a .NET helper class for the Entity Framework, which enables compilation of of database queries for better performance.

CompiledQuery is a .NET helper class for the Entity Framework. It enables user code to compile a query to the source (based on a method signature), to be re-used efficiently with different parameter values.

68 questions
0
votes
1 answer

Stackoverflow Exception with LinqToSQL compiled queries

We're experiencing a strange situation where a LinqToSQL that has compiled queries within it causes a stackoverflow exception when ran locally but when in a live environment runs fine without any issues. The query contains a number of joins and on…
Gaz
  • 1,249
  • 3
  • 19
  • 37
0
votes
0 answers

DataContext CompiledQuery throws NullReferenceException

I have DataContext as a connection to my database and also use pre-compiled queries (CompiledQuery). Here is my code: public static RichTextValue GetRichTextValue(this DataManager db, string key, string lang = LobbyHelper.DefaultLanguage) { …
XpyM
  • 247
  • 4
  • 12
0
votes
2 answers

Performance - get data through navigation property vs compiled query

I have compiled queries for both, the main entity customer and for related entities(orders). var customer = MyService.GetCustomer().where(c => c.Id == fooId).ToList(); var customerOrders = MyService.GetOrders().where(o =>…
0
votes
2 answers

Linq to XML compiled queries

Is it possible to change this Linq to XML statement into a compiled query ? myxmlnodeList2 = From el In mynode. Where el.Attribute("AttributID") = sAttributID.ToLower And el.Attribute("Verwendung") = sVerwendung …
d1chty
  • 3
  • 2
0
votes
1 answer

c# Compiled Queries

I'm trying to make a compiled query, following the MSDN example at http://msdn.microsoft.com/en-us/library/bb896297.aspx Here is my code static readonly Func> s_compiledQuery2…
Lord Vermillion
  • 5,264
  • 20
  • 69
  • 109
0
votes
2 answers

How can I use CompiledQuery

I used the linq to fetch the data from database before, but it looks like using CompiledQuery with Linq should be than using Linq by itself. I've try to use CompiledQuery, but it's throwing an exception. Following is my code: static readonly…
user1531714
  • 111
  • 13
0
votes
1 answer

Reusing LINQ expressions created in a Portable Class Library

Is it possible to create a LINQ expression inside a Portable Class Library and reuse the expression in other parts of the application? One handy use case for me would be to utilize these expressions in CompiledQuerys across platforms instead of…
0
votes
1 answer

LINQ to SQL CompiledQuery Slowing Down

I'm trying to use a CompiledQuery in LINQ to SQL (WP7, C# and a SQLCE 3.5 database), but after the first use the query slows down to uncompiled speeds. I'm new to this, and I'm sure I've missed something obvious, but I'm not sure what. As context, I…
Superangel
  • 1,339
  • 2
  • 10
  • 12
1 2 3 4
5