Using LINQ in Visual Studio for Debugging

Note. . I want to download and install any extension that can be done for this type of thing. The solution does not have to come directly from the standard VS functions.

Question: Is there a way to use LINQ or any other query method to test and view the results of List, Array, IEnumerable, etc., When stopped in the debugger?

I know that you can delete the information contained in an object using an immediate window, but I want to know if there is a way so that I can sort the assembly of the required LINQ with the actual data.

Update:

This is the error I get when trying to use LINQ in the nearest window:

returnRecords.Select (x => x)

error CS1061: "List" does not contain the definition of the "Select" and "No"> "Select" methods, you can accept the first argument of the type "List" (do you have a using directive or an assembly reference?) error CS1061: "List" does not

But it works fine in code

var fu = returnRecords.Select (x => x);

Update 2:

Even that simply like this will not work:

        List<int> abc = new List<int>();
        abc.Add(12);
        abc.Add(15);
        abc.Add(16);
        abc.Add(91);
        abc.Add(81);
        abc.Add(14);
        abc.Add(13);
        abc.Add(10);
        abc.Add(145);
        abc.Add(12);

window:

abc
Count = 9
    [0]: 12
    [1]: 15
    [2]: 16
    [3]: 91
    [4]: 81
    [5]: 14
    [6]: 13
    [7]: 10
    [8]: 145
abc.Where(x => x < 50);
error CS1061: 'List<int>' does not contain a definition for 'where' and no extension method 'where' accepting a first argument of type 'List<int>' could be found (are you missing a using directive or an assembly reference?)
+4
source share
1 answer

, LINQ ; CS1061. using System.Linq; . LINQ , , :

abc.Where(x => x < 50)
{System.Linq.Enumerable.WhereListIterator<int>}
    [0]: 12
    [1]: 15
    [2]: 16
    . . .

LINQ, , :

( !). , LINQ, , , . LINQ debugging at the beginning of the day

- , , LINQ. OzCode, Visual Studio, LINQ in situ. LINQ Debugging with OzCode

+7

Source: https://habr.com/ru/post/1658474/


All Articles