CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    WCF Serialization

    Is it also possible to serialize a method using WCF. For type [DataContract] needs to be used and for members [DataMember] should be used.
    Code:
       [DataContract]
       public class User {
    
          [DataMember]
          public string Name {
             get;
             set;
          }
    
          //I want to to the same thing here
          public override string ToString() {
             return "Hello";
          }
       }
    Note. This is not the service but a type that is passes by the service.

    Is this possible for a method. Or do I need to do this using the service itself?

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: WCF Serialization

    No, it isn't. And it doesn't make sence to have such an ability, because passing methods would break encapsulation.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured