title: Client to WCF: Passing an enum value always gets 0
body: <p>I have the following code written in the service.   </p>
  
  <pre><code>[DataContract]
  public class Email
  {
      private string senderEmail;
      private MyEmailType emailType;
  
      [DataMember]
      public string SenderEmail { get { return senderEmail; } set { senderEmail = value; } }
      [DataMember]
      public MyEmailType EmailType { get { return emailType; } set { emailType = value; } }
  }
  
  [DataContract]
  public enum MyEmailType
  {
      [EnumMember]
      EmailType1 = 1,
      [EnumMember]
      EmailType2= 2
  }
  </code></pre>
  
  <p>I send Email objects to the service like this:</p>
  
  <pre><code>Email email = new Email();
  email.SenderEmail = "someemail@mail.com";
  email.EmailType = MyEmailType.EmailType1;
  
  bool isDispatchSuccessful = myClientObject.SendMassProcessEmail(email);
  </code></pre>
  
  <p>When I get to the service, the SenderEmail property's value is correct, but the EmailType (the enum one) gets 0, instead of 1 (EmailType1).</p>
  
  <p>Why is this happening?</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>I tried passing a MyEmailType variable besides the Email object to the SendMassProcessEmail like this:</p>
  
  <pre><code>bool isDispatchSuccessful = myClientObject.SendMassProcessEmail(email, MyEmailType.EmailType1);
  </code></pre>
  
  <p>Now, the stand-alone enum variable receives a correct value, but the one which is a public member of the Email class still gets a value of 0.</p>