I have roughly 20+ enums that are all the same, but coming from different web service libraries, so when used they all need they're fully namespaced reference like this below
- WebServices_Production_TrustOnline_ARM.yesnounspecified
- WebServices_Development_TrustOnline_ARM.yesnounspecified
- WebServices_Production_TrustOnline_BW.yesnounspecified
- WebServices_Development_TrustOnline_BW.yesnounspecified
- etc
- etc up to 20+
Where each enum is like this below
public enum yesnounspecified
{
unspecified,
yes,
no,
}
In my method I set all the values of a dynamic object, also from each of the different web services and I need to be able to set the enum to (yes/no) but not sure how to pass it in and use it
ex.
MyMethod("something", new WebServices_Production_TrustOnline_ARM.objectToFill());
public void MyMethod(string otherParam, dynamic someObject) {
// 'cigarettes' is a 'yesnospecified' enum
someObject.cigarettes = // need to set the enum value (yes/no) here but not sure how to pass it in and set it
}
(yesnounspecified)(int)x;someObject.cigarettes = yes/nofrom Enum ...right? correct me if am wrong