Articles → WCF → Using Enums In WCF Service
Using Enums In WCF Service
- First of all create a WCF service application.
- From the application remove code from interface and class so your interface and class will be
- Next step is to create an application that will consume the service. For this article, I am creating a console application.
- Last step is adding the service reference. But right now it is not possible because your interface does not have any code. So we will add the reference once we have some method inside our interface.
- The first step is to create an enum in IService1 interface. The syntax will be
- The second step is to add a new DataContract and add enum as DataMember. See the following code.
- Last step will be to create the signature of the method in IService1 interface and pass CompositeType as a parameter. See the following code.
Back To Client Application
Click to Enlarge