How to expose enum attributes to WCF client

前端 未结 4 1631
灰色年华
灰色年华 2021-01-12 13:25

I want to expose enum attributes to WCF client application, but I can only see enum values.

Here is the enum:

public enum TemplateType
{
    [EnumDes         


        
4条回答
  •  无人及你
    2021-01-12 13:59

    I'm not fully versed in the specs, but I doubt this kind of metadata has an equivalent representation in WSDL. Thus, this will not be visible on the client side if you generate the types in your proxy.

    However, if you put all your DataContracts in a separate assembly that you reference in the client, you can reuse those types on the client side. In that case, the attributes would be visible. "Reuse types in referenced assemblies" needs to be checked for your Service Reference, but this is on by default.

    Here's a short blog post about it. I'm sure there are others...

提交回复
热议问题