I am new to WCF and I need help understanding something.
I created a WCF data service that returns DTOs which are mapped from entities by the service. On my service contract interface I have some method GetMyDto returning IQueryable<MyDto>.
I added a service reference to this service in an MVC app. The interface and proxy client then return List<MyDto> (or I can choose a couple other collection types) instead of IQueryable<MyDto>.
I understand IQueryable can’t be exposed to the client, but if I filter on the client (i.e. MyServiceClient.GetMyDto().Where(x => x.SomeValue == 1)) does it filter on the client or the server?
My understanding is that it can use odata, however all the examples I see of this directly expose the entity model to the client, which I am not doing. I am using DTOs.
What are my limitations? Help me understand exactly what is happening when I make the call to the service.
Adding to what Ladislav said (which was entirely accurate):
If you’re using DTOs, you’re in either Reflection Provider land or Custom Provider land. A custom provider allows extreme customization, but is a pretty big learning curve. AlexJ has an excellent blog post series on that very topic. The Reflection Provider has some unfortunate limitations at this point, but it’s hard to enumerate them specifically so it’s best to just try it and see where you run into pain points. If you don’t hit those limitations, it’s very easy to use and will probably do a great job of helping you build your service.
Several members on the team would really like to improve our provider story. I can’t promise that it will be a priority that we work on in the near future, but if there are little things we can fix we’d love to hear it.