What does this mean in the Visual Studio debugger value "{}"?

In my Visual Studio 2008.NET C # project, I have one property and the debugger shows open and immediately closed curly braces "{}". I believe this is an uninitialized (I) list, but why does it not show "null" or "unitialized". What does "{}" mean?

br, Milan.

+4
source share
3 answers

The most likely reason is that the type of value in question overrides the .ToString() method and returns an empty string. This will trigger the display {}, as C # EE completes the return of .ToString inside {} 's

+4
source

If you want to change the value shown in the debugger, you can control it using DebuggerDisplayAttribute . Instead, you can override the .ToString() method. But this may affect other areas of your applications.

+1
source

This may indicate a value of System.DBNull

You can check it as follows:

  foreach (var val in datarow.ItemArray) { if (val == DBNull.Value) { var item = val; } } 
0
source

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


All Articles