How can I get the values for an enumeration if I am using SOAP or the .NET SDK ?
Answer
Summary
With .NET, you can make use of the Enum class and use the method GetNames to get the array of the names of the constants in a specified enumeration. Detailed Description
Here is a C# example that retrieves the list of HitCounter values:
using System; using eBay.Service.Call; using eBay.Service.Core.Sdk; using eBay.Service.Util; using eBay.Service.Core.Soap;
namespace SDKSamples {
public class SDKSamples {
public void GetEnumValues() { string[] counters = Enum.GetNames(typeof(HitCounterCodeType)); //iterate over the array for (int i =0; i < counters.Length; i++) { //iterate over the array and access the value using counters[i] }
}
}
}
How well did this answer your question?
Thank you for helping us to improve the eBay developer program.
While we are not able to respond directly to your comments, we will carefully review them to improve your experience with eBay developer program!