Best practice ADO.NET Dataservice

Thread is closed for posting
2 posts, 0 answers
  1. Henk
    Henk avatar
    114 posts
    Member since:
    Apr 2006

    Posted 02 Nov 2009 Link to this post


    If I build an ADO.NET dataservice using the OA WCF wizard the OA classes from my model are available in the ADO.NET dataservice.
    If I want to add an extra filter to the query, based on for instance the user role, when using the ADO.NET dataservice I can write a query interceptor. That's no problem. But what to do when I do not want to expose all the fields of the class?
    In one application based on my OA model I want to use all the fields of the class mapped to the columns of the database table.
    In my ADO.NET Dataservice I do not want to expose all the fields of the classes.
    What's the best place to define the fields which are exposed in the ADO.NET Dataservice?
  2. Zoran
    Zoran avatar
    534 posts

    Posted 05 Nov 2009 Link to this post

    Hello Henk Boen,

    There is no way to expose just some desired fields out of the box. As a workaround though, I could suggest you make a hierarchy for the classes that you do not want fully exposed on the client side of the ADO .NET Dataservice. In that case you can put the fields you want exposed in the base class and the rest in the derived class. That way you can manipulate the visibility of your fields in different scenarios.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top