title: Class constructor (from C# web service) won't auto-implement properties in C# MVC
body: <p>I'm running two instances of VS2010 on my local machine. One instance is running my Web Service (written in C#). The other instance is running my MVC web app (also C#). The MVC web app has a reference to the web service. I can successfully invoke web service methods from within the MVC app.</p>
  
  <p>In my web service is a <code>PageNavigation</code> class:</p>
  
  <pre><code>// PageNavigation.cs
  using System;
  using System.Collections.Generic;
  using System.Text;
  
  public class PageNavigation
  {
      public string Page_Number { get; set; }
      public string Page_Count { get; set; }
  
      public PageNavigation()
      {
          Page_Number = "1";
          Page_Count = "2";
      }
  }
  </code></pre>
  
  <p>By default, this <em>should</em> return an object with auto-implemented properties when I call the class constructor:</p>
  
  <pre><code>WebService.PageNavigation pageNavigation = new WebService.PageNavigation();
  </code></pre>
  
  <p>This works when constructing a PageNavigation object elsewhere in the web service. </p>
  
  <pre><code>pageNavigation.Page_Number
  "1"
  pageNavigation.Page_Count
  "2"
  </code></pre>
  
  <p>However, running the same line of code on the MVC isn't giving the same result; the object's properties are all null values. </p>
  
  <pre><code>pageNavigation.Page_Number
  null
  pageNavigation.Page_Count
  null
  </code></pre>
  
  <p>Is this the expected behavior? Is there a way to populate the properties with default values as intended? If more information is needed please let me know and I will update the question.</p>