Tutorial :WCF data contract



Question:

I have a data contract and I defined some constant variables in it and have [DataMember] tag for each constant variables. However, my client side does not retrieve those constant variables. I want those constant variables synchronized with the WCF service every time I update the metadata of my WCF service at my client side. I don't want to manually add or change by hand.

Does anyone know how to do it?


Solution:1

What kind of constants are you talking about? If it's just integers, why not use an enum instead?

Otherwise, there is no way to expose constants directly as part of your contract in the WSDL/mex, so either you'll need to share CLR types directly, or share the constants with your clients through other means (documentation, etc.).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »