locked
Lightswitch 2013 entity query returns null for a related many:1 required property when many entities are returned RRS feed

  • Question

  • I have a Payments entity which includes a paymentMethodCode foreign key coming from a PaymentMethods entity. I use a WebApi call to generate a report on the server listing payments. If the report only selects a few payments, they all have valid data for the PaymentMethod property. When the report selects hundreds of payments, all the PaymentMethod properties are null. The database does not allow null values for Payments.paymentMethodCode, and I have verified that all payments have legitimate values.

    The data is being retrieved on the server with ServerApplicationContext, e.g.,

    using (ServerApplicationContextsc= ServerApplicationContext.CreateContext())
    {work done here}.

    Does anyone have any ideas on how to force the PaymentMethod to be returned? Or how to retrieve the underlying foreign key Payments.paymentMethodCode attribute directly, which would be good enough in this case. I have noticed that in a few cases Lightswitch includes the foreign key attributes in an entity, but not in most cases. Is there any way yet to force foreign key attributes to be included in the entity model?


    Paul

    Monday, February 3, 2014 5:22 PM