c# - Check if an azure message has a property -
i've added custom properties azure brokeredmessage
such message.properties["staffdealingwith"];
i'm looking find out if message contains property (e.g. staffdealingwith).
if (message.properties.contains("staffdealingwith")) { tm.staffdealingwith = (string)message.properties["staffdealingwith"]; } however giving me compile error. 'system.collections.generic.icollection>.contains(system.collections.generic.keyvaluepair)' has invalid arguments c:\codetfsarklepos\arkle\roboweb.azure\messagefetcher.cs 180 17 roboweb.azure
the type of message microsoft.servicebus.messaging.brokeredmessage
you don't specify type message suspect message.properties dictionary<string, object> need use containskey instead.
dictionary<string, object> implements icollection<keyvaluepair<string, object>> exposes contains method well!
Comments
Post a Comment