Ria Service: Null Included Objects When Returning Back to Service
I am using the attribute Include
on my properties and they are being passed to the client correctly, but once I sent it back to the ria service for further processing it is now null.
internal sealed class lSyncMetadata
{
private lSyncMetadata()
{
}
public string ConflictMessage { get; set; }
public DateTime DateInserted { get; set; }
public Guid vValueId { get; set; }
[Key]
public Guid ID { get; set; }
public bool IsConflict { get; set; }
public bool IsReadyToSync { get; set; }
public Guid SyncSet { get; set; }
[Include]
public vValue vValue { get; set; }
}
source to share
The RIA Services client does not serialize any property other than value type and string because normal navigation properties can result in circular references and it will be impossible to determine what to send and what not to send. Moreover, to reduce network traffic and maintain proper change tracking, ChangeSets are sent by RIAs, but only for tracked objects.
RIA services are designed to replicate Entity tracking on the client side, and you must update, get navigation properties (related objects) on demand, and you must let RIA services control dispatches and what not to send.
However, Include only works from server to client, it does not work with Client to Server, indeed if you make changes to the navigation properties RIA Services will correctly detect and dispatch ChangeSets.
For anything other than that, you would have to create a regular WCF service or web service to get the job done and to access it from the client.
Complex types are supported, including only value types, but they cannot be an Entity type that has an Entity key.
source to share