ADO.NET Data Services Hooking POC

When you use ADO.NET Data Services, you will reduce the flow between the client and the server to get only the entities you really want. If you use EF with ADO.Net Data Services, you will also reduce the flow between the Server and the DB.


EF (particularly in the first version) doesn’t support all cases. So sometimes, you need to develop your own entity classes which encapsulate your EF ones.


In this case, with ADO.NET Data Services, the flow between the Server and the DB isn’t optimized. I made this POC to do this scenario.



When I did it, I realized that the ADO.NET Data Services Framework is extremely closed and most of classes / interfaces / enums are internal. I think that something will change in V2. For example, you have an internal interface System.Data.Services.Providers.IDataServiceProvider only implemented by System.Data.Services.Providers.BaseServiceProvider which is an internal abstract class. I think in a future version, the interface will be public. Else I don’t understand why the interface is used for.


To be able to hook the normal ADO.NET Data Services way, I have two choices:


·         I rewrite a lot of the ADO.NET Data Services internal classes


·         I use, by reflection, the Internal classes


The first choice is probably the best one because as the classes are internal, MS can change their members in the future version but, as it’s just a POC, I choose the second choice which is fastest.

This entry was posted in 7671, 7674, 8975, 9060. Bookmark the permalink.

2 Responses to ADO.NET Data Services Hooking POC

  1. Martintr says:

    Hi Matthieu
    I have been having a look at this and am impressed how easy to understand it is.

    I know this is a POC but is it something you would consider using in a real app?

    Keep up the great work.

    Thanks
    Martintr

  2. Matthieu MEZIL says:

    Hi.
    Yes I want to do a real demo application with this in the future. The hardest is to find time. :-)
    Matthieu

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>