title: IEnumerable of object returns JSON, but IEnumerable of similar object does not
body: <p>I have two classes that are similar. I'm trying to see if I can simply use one. The first is in our DataModel assembly, and used in our DbContext.</p>
  
  <pre><code>public partial class type210_MotorCarrierFreightInvoice
  {
      public int MotorCarrierFreightInvoiceId { get; set; } // MotorCarrierFreightInvoiceId (Primary key)
      public string InvoiceId { get; set; } // InvoiceId
      public DateTime BillDate { get; set; } // BillDate
  
      public string TrackingNumber { get; set; } // TrackingNumber
  
      public decimal NetShipmentCharge { get; set; } // NetShipmentCharge
  
      public long InterchangeTransactionDetailId { get; set; } // InterchangeTransactionDetailId
  
      public long? BillToAddressId { get; set; } // BillToAddressId
      public long? ConsigneeAddressId { get; set; } // ConsigneeAddressId
      public long? ShipperAddressId { get; set; } // ShipperAddressId
  
      // Foreign keys
      public virtual interchange_TransactionDetail interchange_TransactionDetail { get; set; } // fk_Type210_MotorCarrierFreightInvoice_Interchange_TransactionDetail
      public virtual typeAny_Address typeAny_Address_BillToAddressId { get; set; } 
      public virtual typeAny_Address typeAny_Address_ConsigneeAddressId { get; set; } 
      public virtual typeAny_Address typeAny_Address_ShipperAddressId { get; set; } 
  
      public type210_MotorCarrierFreightInvoice()
      {
          InitializePartial();
      }
  
      partial void InitializePartial();
  }
  </code></pre>
  
  <p>The second class should represent the same object.</p>
  
  <pre><code>public class Type210MotorCarrierFreightInvoice
  {
      public int MotorCarrierFreightInvoiceId { get; set; }
      public string InvoiceId { get; set; }
      public DateTime BillDate { get; set; }
  
      public string TrackingNumber { get; set; }
  
      public decimal NetShipmentCharge { get; set; }
      public long InterchangeTransactionDetailId { get; set; }
      public Address BillToAddress { get; set; }
      public Address ConsigneeAddress { get; set; }
      public Address ShipperAddress { get; set; }
  }
  </code></pre>
  
  <p>I'm working with a WebApi service that will expose the data via JSON. Basically what I'm trying is this:</p>
  
  <pre><code>[Route("api/Subscriber/Get210sNew/{transactionId}")]
  [Route("api/Subscriber/Get210sNew/{transactionId}/{limit}")]
  public IEnumerable&lt;type210_MotorCarrierFreightInvoice&gt; Get210sDOES_NOT_WORK(int transactionId, int limit = DefaultLimit)
  {
      var key = new QueryAfterId(transactionId, limit);
      var dataService = new Type210DataService(_ediContext);
      return dataService
              .Get(key)
              .Select(x =&gt; x);
  }
  
  [Route("api/Subscriber/Get210s/{transactionId}")]
  [Route("api/Subscriber/Get210s/{transactionId}/{limit}")]
  public IEnumerable&lt;type210_MotorCarrierFreightInvoice&gt; Get210sWorks(int transactionId, int limit = DefaultLimit)
  {
      var key = new QueryAfterId(transactionId, limit);
      var dataService = new Type210DataService(_ediContext);
      return dataService
              .Get(key)
              .Select(Map);
  }
  </code></pre>
  
  <p>Here is the <code>Map</code> method:</p>
  
  <pre><code>private static Type210MotorCarrierFreightInvoice Map(
      type210_MotorCarrierFreightInvoice dbNotice)
  {
      return new Type210MotorCarrierFreightInvoice
      {
          MotorCarrierFreightInvoiceId = dbNotice.MotorCarrierFreightInvoiceId,
          InvoiceId = dbNotice.InvoiceId,
          BillDate = dbNotice.BillDate,
          ShipDate = dbNotice.ShipDate,
          TrackingNumber = dbNotice.TrackingNumber,
          PurchaseOrderNumber = dbNotice.PurchaseOrderNumber,
          BillOfLading = dbNotice.BillOfLading,
          NetShipmentCharge = dbNotice.NetShipmentCharge,
          InterchangeTransactionDetailId = dbNotice.InterchangeTransactionDetailId,
          BillToAddress = Mapper.MapToAddress(dbNotice.typeAny_Address_BillToAddressId),
          ConsigneeAddress = Mapper.MapToAddress(dbNotice.typeAny_Address_ConsigneeAddressId),
          ShipperAddress = Mapper.MapToAddress(dbNotice.typeAny_Address_ShipperAddressId)
      };
  }
  </code></pre>
  
  <p>Get210sWorks will return Json data to the browser. Get210sDOES_NOT_WORK does not. Both queries get the same number of records. But Get210sDOES_NOT_WORK shows no records in the browser window.</p>
  
  <p>Why can't I return an IEnumerable of my DataModel class as Json?</p>