How do we check whether a dynamic clay object has a property?
问题 I have a dynamic object, that I think is implemented with Clay . It has one of two possible property names. I want to use which ever property name is available. The following doesn't work: dynamic workItemPart = item.WorkItem; // is an Orchard.ContentManagement.ContentPart var learnMore = workItemPart.LearnMore ?? workItemPart.LearnMoreField; It throws a Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : does not contain a definition for 'LearnMore' How do we check if a dynamic Clay