WCF data contract
I have a data contract and I defined some constant variables in it and have [DataMember] tag for each constant variables.开发者_如何学Go 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?
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.).
精彩评论