Questions tagged [linq-expressions]
An API for composing code with declarative expression trees, used by LINQ and the DLR.
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 ...
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 ...
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: ...
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: ...
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 ...
Calculating user efficiency on a time period with Linq
I have this expression: ...
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 ...
A simple method to execute Entity Framework Core queries in parallel
As you might know, EF Core does not support executing multiple queries in parallel on the same context using something like Task.WhenAll. So you have to write this ...
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? ...
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 ...
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: ...
Chain LINQ expressions for filtering
Example of my method where I am chaining linq expressions based on model values provided: ...
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: ...
Merging every two objects into single single object making group by a property C# LINQ [closed]
I have a object list like below. I want to join every two rows into single row based on column B. It is sure that only two rows would be there for every single column B value. Input Output However, ...