Skip to main content

Microsoft Silverlight

Answered Question A Service with CONST parameter and some functionsRSS Feed

(0)

royal_blue
royal_blue

Member

Member

214 points

47 Posts

A Service with CONST parameter and some functions

I have a class in a  Silverlight enabled WCF Service.

I can access this class and [DataMember] parameters.

But I can't access CONST parameters and Methods in class  on client side.

How can I do? (Sory my bad english)


[DataContract]
public class UserItem
{
   [
DataMember]
   public Guid SessionID { get; set; }
   [DataMember]
   public string Username { get; set; }
   ...
   ...
   ...
   public const int A_CONST_PARAMETER_1 = 1;
   public const int A_CONST_PARAMETER_2 = 2;
   ...
   ...
   public bool SomeMethod(int param)
   {
      ...
      ...
   }
}

Hope it helps you !

~~~~~~~~~~~~~~~~~~
Please "Mark as Answer" if this post answered your question. :)

Min-Hong Tang - MSFT
Min-Hong...

Contributor

Contributor

3376 points

377 Posts

Answered Question

Re: A Service with CONST parameter and some functions

Hi,

   I am afraid The DataMemberAttribute  is ignored if it is applied to static members. This is quoted from msdn document. This is the link:

    http://msdn.microsoft.com/en-us/library/ms733127.aspx

   You can share with us the situation you are dealing with , in that case, maybe we can find some workarounds for you.

Best Regards

 

Min-Hong Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities