M
M
mr_blond972018-01-16 13:11:20
SQL
mr_blond97, 2018-01-16 13:11:20

How to do .where() filtering in Immediate Window?

The breakpoint is on the next line after GetQuery():
var query = _dataContext.GetQuery<SomeType>();
In Visual Studio, in the Immediate Window, you can execute ToList():

query.ToList();
Count = 1
    [0]: {HelloQueryProject.Entities.DataBaseModel.SomeType}

but .Where().ToList() fails:
query.Where(p => p.SomeField == null).ToList();
Evaluation of method System.Linq.Expressions.Expression.Property requires reading field System.Reflection.RuntimeMethodInfo.m_handle, which is not available in this context.

How to make such filtering in Immediate Window?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Pavlov, 2018-01-16
@lexxpavlov

Make a method where filter with a loop, not a Linq query.

G
GREGOR_812, 2018-11-22
@GREGOR_812

Do it not in Immediate Window, but in Watch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question