Copy object values in Visual Studio debug mode

前端 未结 12 723
轻奢々
轻奢々 2021-01-29 19:17

In Visual Studio debug mode it\'s possible to hover over variables to show their value and then right-click to \"Copy\", \"Copy Expression\" or \"Copy Value\".

In case t

12条回答
  •  你的背包
    2021-01-29 19:40

    if you have a list and you want to find a specific variable: In the immediate window, type

     myList.Any(s => s.ID == 5062);
    

    if this returns true

    var myDebugVar = myList.FirstOrDefault(s => s.ID == 5062);
    ?myDebugVar
    

提交回复
热议问题