Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
0 answers
56 views

EF6 generates WHERE clause in unexpected order

I'm using the solution from this answer to form an Expression<Func<Proposal, bool>> object (where Proposal is an entity type in my app), according to the searching criteria input on a ...
Jyunhao Shih's user avatar
  • 1,478
2 votes
1 answer
413 views

In LinqToEntities, How to pass dynamic column name to DbFunctions.Like

I have an IQueryable<T> from my DbSet in Entity Framework. I am provided a "Fuzzy Search String", named searchText, like so: public List<T> Search<T>(string searchText) { using ...
Suamere's user avatar
  • 6,298
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
10 votes
1 answer
3k views

System.Core error: "Code supposed to be unreachable" using C# Entity Framework and Linq with Expression

I'm getting a "Code supposed to be unreachable" error when executing the following Linq to Sql statement. I'm using EF 6.1.3. I think this is a known bug related to filtering a navigation property. It ...
SteveB's user avatar
  • 271
1 vote
1 answer
183 views

Reuse ViewModel materializer in multiple EF queries?

I'd like to reuse the method that hydrates a view model from an Entity Framework 6 IQueryable<TEntity>. Most intuitively to me, that would look something like this: ViewModel ToViewModel(Record ...
shannon's user avatar
  • 8,784