Questions tagged [linq-expressions]

An API for composing code with declarative expression trees, used by LINQ and the DLR.

Filter by
Sorted by
Tagged with
10
votes
2answers
781 views

Expression Conversion

Using Entity Framework we have a number of entities, which we want to hide from the rest of the calling code to remove the direct dependency on the database. We're doing so by using DTOs, which for ...
1
vote
4answers
3k views

Chain LINQ expressions for filtering

Example of my method where I am chaining linq expressions based on model values provided: ...
1
vote
3answers
184 views

Get a collection of child positions for a given parent position

I am trying to get a complete tree in a single loop using an iterative function. For instance, this is what I have: ...
4
votes
1answer
4k views

Change UI display order of an ObservableCollection

I have an ObservableCollection that is filled with custom elements of type Video runtime. These have the properties of Name, Rating and Number of Viewers. I want to ...
2
votes
1answer
101 views

Group a list of products and services

I'm working with a third part service of my client that is providing me a list of products and services, which is a little bit of a mess. The list will return all of the ...
10
votes
2answers
8k views

Generate a LINQ Expression Tree from a filter string

I have a C# Service that takes a filter string and a FilterMap class and generates an Expression<Func<T, bool>> for ...
1
vote
0answers
179 views

Join via navigation properties with collection

There are some related collection objects in my table and I'm trying to get list with joining this tables. But this code is seems bad: Entities that shortened: User: ...
5
votes
1answer
165 views

Calculating user efficiency on a time period with Linq

I have this expression: ...
2
votes
2answers
131 views

Method for validating properties based on passed conditions

I wrote a method for validating properties based on passed conditions. It works well, but declaration takes more space than the actual condition. Is there any way to make it shorter? ...
6
votes
1answer
466 views

IQueryable Extensions working on expression for collection property

Followup to Repository searching code duplication My goal currently is to make the current implementation of my repository's IQueryable filtering less duplicative. First, I looked into passing ...
7
votes
1answer
259 views

LINQ Provider: Supporting Projections

Up until recently, my LINQ-to-Sage provider didn't support projections, so the client code had to explicitly "transfer" to LINQ-to-Objects, like this: ...
10
votes
3answers
2k views

Tracking Entity Changes (not EF)

So, I kept refactoring my Sage300 API wrapper - I wanted the client code to feel just like using Entity Framework - this is the closest I got to it: ...