title: CreatedAt property null when working with Offline tables in Azure Mobile Services
body: <p>This is a basic example to show the issue.</p>
  
  <p>I have a MobileServiceClient and offline SyncTable</p>
  
  <pre><code>private MobileServiceClient client = new MobileServiceClient("http://localhost:19087/");
  private IMobileServiceSyncTable&lt;TodoItem&gt; todoTable;
  </code></pre>
  
  <p>I have a TodDoItem.cs on the client</p>
  
  <pre><code> public class TodoItem
  {
      public string Id { get; set; }       
      public DateTimeOffset? CreatedAt { get; set; }
      public DateTimeOffset? UpdatedAt { get; set; }
      public string Text { get; set; }
      public bool Complete { get; set; }
  }
  </code></pre>
  
  <p>I initialise my offline Database like so </p>
  
  <pre><code>async Task Initialise()
      {
          if (!client.SyncContext.IsInitialized)
          {
              var store = new MobileServiceSQLiteStore("todo.db");
              store.DefineTable&lt;TodoItem&gt;();
              await client.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler());
          }
          todoTable = client.GetSyncTable&lt;TodoItem&gt;();
      }
  </code></pre>
  
  <p>and sync online data with offline here</p>
  
  <pre><code>async Task RefreshData()
      {
          await todoTable.PullAsync("todo", null);
          var result = await todoTable.ToCollectionAsync();
          listItems.ItemsSource = result;
      }
  </code></pre>
  
  <p>Now the problem here is the CreatedAt property is always null. If I make the property non nullable then it shows as date 01/01/0001 (basically DateTime.Min). The record in the DB has the correct date. Testing with fiddler shows the correct date is being serialized ok from the MobileService</p>
  
  <p>If I change to an online environment ie </p>
  
  <pre><code>private IMobileServiceTable&lt;TodoItem&gt; todoTable;
  </code></pre>
  
  <p>then everything works as expected. CreatedAt is showing the correct date.
  I have tried a JsonConverter as shown by <a href="http://blogs.msdn.com/b/carlosfigueira/archive/2013/05/13/preserving-date-time-offsets-in-azure-mobile-services.aspx" rel="nofollow">Carlos' fix here</a> but that doesnt work as the date is already 01/01/0001 (wrong) as it enters the converter.
  I really need to order records by date and cant figure out why this isnt working in the offline environment. Any help appreciated.</p>