2

I'm using WCF Dataservice to get my entities from DbContext. My Entities have a complex type which contains some metadata (DateTime and Guid properties). Here is my code:

 var uri = new Uri(webServiceUrl);
            service = new DataServiceContext(uri);
            localcontext = Globals.DbConnection.Create();

            var list = service.CreateQuery<ActivityCode>("DbActivityCodes").Expand("Parent").Expand("ReplicaInfo").Where(x => x.ReplicaInfo.CreatedById != Guid.Empty);

This code throws an exception:

Cannot compare elements of type 'Crm.Objects.ReplicaInfo'. Only primitive types (such as Int32, String, and Guid) and entity types are supported.

Another problem is that if I remove Where query expression I find out that my complextype ReplicaInfo is empty.

So here are my questions:

  • How can I get complex types through WCF dataservice?

  • How can I filter by complex types through WCF dataservice?

DolceVita
  • 2,090
  • 1
  • 23
  • 35

0 Answers0