Questions tagged [custom-linq-providers]

20 questions
12
votes
6 answers

Expose IQueryable Over WCF Service

I've been learning about IQueryable and lazy loading/deferred execution of queries. Is it possible to expose this functionality over WCF? I'd like to expose a LINQ-to-SQL service that returns an IQueryable which I can then perform additional queries…
7
votes
1 answer

Why would you quote a LambdaExpression?

I've read this answer and understood from it the specific case it highlights, which is when you have a lambda inside another lambda and you don't want to accidentally have the inner lambda also compile with the outer one. When the outer one is…
Water Cooler v2
  • 29,006
  • 41
  • 139
  • 286
6
votes
1 answer

LINQ passthrough provider?

I've implemented simple IQueryable and IQueryProvider classes that collect statistical data on LINQ expression trees. This part works fine. Next, I would like to pass the expression tree off to the default LINQ-to-Objects provider for evaluation,…
Dan Barowy
  • 2,202
  • 23
  • 35
4
votes
1 answer

How to use a LINQ provider from F#?

What is a proper way of using LINQ queries in F# when using a provider (LINQ to NHibernate for example) so as to work the same as in C# (same AST)? My specific issue is that translating a query to F# throws an error while the C# one works. This…
Răzvan Flavius Panda
  • 20,376
  • 13
  • 101
  • 153
4
votes
2 answers

System.Linq.Expressions.ExpressionVisitor is inaccessible due to its protection level

I'm trying to follow the instructions on Creating an IQueryable LINQ Provider, but when I implement the classes which inherit from ExpressionVisitor as instructed I am told that ExpressionVisitor is inaccessible due to its protection level. Am I…
tags2k
  • 70,860
  • 30
  • 74
  • 105
3
votes
2 answers

Does the LINQ Expression API offer no way to create a variable?

I want to validate my assumption that the LINQ Expression API does not have any means for us to create an expression that represents the creation of a local variable. In other words, you cannot create an expression to represent: int local; since…
Water Cooler v2
  • 29,006
  • 41
  • 139
  • 286
3
votes
1 answer

Finding what methods a LINQ provider supports

I just tried to use Contains in an Entity Framework query only to have it fail as this method doesn't exist in EF. However the code compiles which is frustrating. Does anyone know how to find which methods a LINQ provider supports, given any LINQ…
Alex Angas
  • 56,458
  • 39
  • 130
  • 203
2
votes
3 answers

Determining scope of a MemberExpressions target

Is there anyone here with experience writing custom Linq providers? What I'm trying to do is tell whether a MemberExpression that is a property on a business object should be included in the SQL, or treated as a constant, because its from a local…
David Wengier
  • 9,655
  • 5
  • 35
  • 43
1
vote
1 answer

Is there an existing Expression to Azure Data Explorer (Kusto) query converter?

Is there an existing, preferably official, implementation of a tool that takes as input an Expression and converts it to Azure Data Explorer query? I am trying to avoid having to implement my own ExpressionVisitor doing just that. I need only quite…
1
vote
1 answer

Custom linq provider to search into an XML field for an xml attribute with a certain value

Some of my database tables, which I interact with through NHibernate, contain an XML field with the following structure: Attribute1 a_value
Carlo Arnaboldi
  • 305
  • 2
  • 13
1
vote
2 answers

What does System.Linq.Expressions.Expression.CanReduce property mean?

From the documentation, and its name implying, it can be inferred that the value of the CanReduce property must be set to true for all expressions that can further be decomposed into smaller expressions, and vice-versa. But upon closer observation,…
Water Cooler v2
  • 29,006
  • 41
  • 139
  • 286
1
vote
2 answers

How is it possible for a LINQ provider to transform arbitrary code?

I understand that a LINQ provider is the "thing" that transforms the actual LINQ query into a SQL query (or whatever). It does so by traversing the AST of the LINQ query, and rendering an appropriate SQL query. So far, so good. Now I can imagine…
Golo Roden
  • 112,924
  • 78
  • 260
  • 376
1
vote
2 answers

Translating Where() to sql

I saw DamienG's article (http://damieng.com/blog/2009/06/24/client-side-properties-and-any-remote-linq-provider) in how to map client properties to sql. i ran throgh this article, and i saw great potential in it. Definitely mapping client properties…
MBoros
  • 1,040
  • 7
  • 19
0
votes
2 answers

Building a dynamic LINQ query

I have a listbox which users can select from a list if Towns, I want to be able to build a LINQ query based on the selected items in the list e.g. Dim ddlTowns As ListBox = CType(Filter_Accommodation1.FindControl("ddlTowns"), ListBox) If Not…
David
  • 11
  • 1
0
votes
1 answer

Querying external data source with LINQ

I'm storing what basically amounts to log data stored in CSV files. It's of the format ,,, etc. However, the log files are stored by account ID and month, so if you query across months or account IDs you're going to retrieve…
Slothario
  • 2,322
  • 2
  • 24
  • 44
1
2