Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
91 views

How add MemberInitExpression into Bindings other Lambda MemberInitExpression

I have the following classes: class Source { public int Id { get; set; } public string Name { get; set; } public SourceItem Item { get; set; } } class SourceItem { public Guid Id { ...
student0011001's user avatar
1 vote
2 answers
479 views

Proper way to query DataContext using Group by that has fields with Nulls

I'm using Entity Framework, And I'm querying the Data using a Group By clause. In the Group by there are multiple columns that have to be used. Some of the columns can have nulls. The issue is that ...
Joe Ricklefs's user avatar
1 vote
2 answers
407 views

Create a Linq to entities IQueryable extension for date grouping (GroupBy)

I am trying to build an expression tree for a custom grouping by date, transform this: groupedData = entity.GroupBy(e => new DateTime(e.created_date.Year, 1, 1)); Into an extension that does not ...
Vitor Mota's user avatar
0 votes
0 answers
264 views

Using a function defined as a Linq.Expression in VB.NET

I found this question's accepted answer very informative to use Expressions with Linq to Entities. I can't figure out the VB.NET syntax, however. Given something like (this part being in C# is fine) ...
MPelletier's user avatar
  • 16.7k
1 vote
1 answer
80 views

Is there a way to more easily combine Expressions and lambdas?

Let's say I have an Expression<Func<Foo, Bar>> calculateBar which 'reduces' a Bar into a Foo, which I can use like so: IQueryable foo = getFoos(); bars = foo.Select(calculateBar); However,...
Liam Dawson's user avatar
  • 1,199
-1 votes
2 answers
282 views

Is it possible to simplify this LINQ expression for Entity Framework?

I'm implementing a basic search service, and several different repositories are injected into it. The repositories have a method that allows for an expression to be used like so: public ...
user9993's user avatar
  • 6,198
1 vote
1 answer
872 views

LINQ Expression for CROSS APPLY two levels deep

Fairly new to LINQ and am trying to figure out how to write a particular query. I have a database where each CHAIN consists of one or more ORDERS and each ORDER consists of one or more PARTIALS. The ...
ekramer17's user avatar
0 votes
1 answer
1k views

"LINQ to Entities does not recognize the method 'Boolean ***, and this method cannot be translated into a store expression."

I am coding a MVC 5 internet application, and am getting the following error: base = {"LINQ to Entities does not recognize the method 'Boolean ...
Simon's user avatar
  • 8,351
0 votes
2 answers
1k views

Entity Navigation Property IQueryable cannot be translated into a store expression

im using Entity Framework designer first and I need to create custom Model Objects starting from the db objects. I don't want to use IEnumerable cause it will query too many fields. The goal is to ...
Simone's user avatar
  • 342
12 votes
4 answers
25k views

Dynamically add new lambda expressions to create a filter

I need to do some filtering on an ObjectSet to obtain the entities I need by doing this : query = this.ObjectSet.Where(x => x.TypeId == 3); // this is just an example; Later in the code (and ...
user avatar
2 votes
1 answer
5k views

Cross-Join Syntax in Entity Framework / IQueryable

I'm trying to deepen my education about IQueryable custom providers and expression trees. I'm interested in custom parsing a cross-join (viz. SelectMany), and I'm trying to understand if that is ...
Brent Arias's user avatar
  • 30.2k
0 votes
1 answer
118 views

In join how to segregate the select statement

In my project one table is connected with two or more tables ,To require wanted out put need to join them,Join is not my problem ,after join want to select desired column but from a segregate ...
shamim's user avatar
  • 6,778
-1 votes
1 answer
160 views

Linq Expression on sub child entities for n levels

Need Generic expression for the below Query. I don't want to use the Dynamic library and Predicate builder. I am generating expressions dynamically. var test = entity.User.Where(PUser => PUser....
user1374303's user avatar
1 vote
2 answers
1k views

linq to entities and store expression

I work on project that use some dynamic linq query to an entities. i have huge amount of case and to avoid code duplication i refactoring to a method. But using method which isn't in store expression ...
bor1s's user avatar
  • 39
5 votes
2 answers
2k views

EF orderby / thenby combo extension method

I want to be able to apply combo firstby / thenby sorting as follows: allOrders().sort(s => s.ProductName, s => s.OrderDate) So using this post as inspiration, I wrote this extension method, ...
Bobby B's user avatar
  • 2,325

15 30 50 per page