Abbas Hamza

Abbas Hamza

  • NA
  • 100
  • 52.8k

how to convert to Enum type

Dec 10 2013 6:27 PM
Hi Guys i have created CService Parameter [dataContract] which will allow me to add one or more parameter for static method as required:
CServiceParameter oCustomer_in = oCustomerDetails_in.ServiceParameterList.Find(delegate(CServiceParameter oTargetParameter) { return oTargetParameter.ParameterName == "Enum"; }) ?? new IACustomermanager.CommonObjects.CServiceParameter()
and i have a request that require 2 Parameters one of them is type Enum e.g 333,444.555
but when i try to add the requested parameters as follow

MyService.MyMethod oCustomerDetailsRequest = new MyService.MyMethod { CSUID = Convert.ToString(oCustomerRefParameter), SaleBase =oCustomerSalesBase_in }; 
it do complain about converting oCustomerSalesBase_in  as it requires an Enum type
the question how can i convert this parameter to  return an Enum type
yhank you in advance

Answers (3)