I'm debugging an application and in some moment, I have a list with amount of items, which prevent me watch each element step by step. I wanted to check what value is inside property Layer of element with PropertyName = "XXX". Is there any simple way to do that?
Outer piece of code:
var metadata = FieldsConfigurationProvider.GetAllFieldsConfiguration();
RequestDocumentTypeModel model = new RequestDocumentTypeModel()
{
Requester = CurrentUser.Login,
MetadataItems = metadata.Where(f => !f.IsSystemGenerated).Select(f => new RequestDocumentMetadataItem(f.DocumentModelPropertyName, f.DisplayName, false, f.Layer)).ToList()
};
// BREAKPOINT HERE
// # MORE CODE #
Of course I can't use Immediate Window and LINQ, because LINQ isn't allowed. I'm using Visual Studio 2010, but as far as I know, other versions have the same "problem".
If you need to check the whole list at once, try DebuggerDisplayAttribute
on the RequestDocumentMetadataItem
in MetadataItems
[DebuggerDisplay("DisplayName = {DisplayName} PropertyName = {PropertyName}")]
I wanted to check what value is inside property Layer of element with PropertyName = "XXX". Is there any simple way to do that?
Yes, you can specify a breakpoint condition. Then it stops only when the condition is met.
In your case:
PropertyName == "XXX"
How to: Specify a Breakpoint Condition
Remember that you never specify a condition like PropertyName = "XXX"
since that changes the variable value silently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With