OpenAccess Query serialization

2 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    2 posts
    Member since:
    Nov 2010

    Posted 01 Feb 2013 Link to this post

    Hello,

    I am building an API using objects from an OpenAccessORM model.
    My goal is to let API consumers to build their queries, serialize them to be able to them through a WCF call to a remote service.

    I tried such solutions serializing classic LINQ syntax, but it looks like WCF serializer does not like LINQ objects...
    Is there a simple way to achieve this using OpenAccessORM?

    Cheers,
    Ben
  2. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 04 Feb 2013 Link to this post

    Hello Bejamin,

    OpenAccess uses the Expression Tree framework provided by Microsoft in .Net Framework. We are not providing the feature you are requesting. There are several open-source projects that aim to make .Net Expression Trees serializable. You can take a look at this discussion in StackOverflow.

    I would like to propose a different approach for your scenario.
    You can try OData-enabled services that support query LINQ-like queries that are expressed through the URL address of the request.

    Your first choice can be Microsoft Data Services v5.0 (or after Q1 2013 release of OpenAccess you can use the latest version 5.2). There you will be able to use a client side mirror of your database context, query against it and have your queries executed on the server (and database server) side. This technology is mature and has wide adoption.

    The other option that you can consider is Web API. The approach is similar to Data Services, but you are not restricted to using only entity types described in a context, but any type or method that you like.

    Please let me know if you need more information or need any further assistance getting started with Data Services or Web API and OpenAccess.

    Greetings,
    Viktor Zhivkov
    the Telerik team
    Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
  3. DevCraft banner
Back to Top