OpenAccessLinqDataSource in N-layer application

4 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 24 Aug 2012 Link to this post

    In my application, there are four projects:WebUI, Entity, DataAccess, Service. In Entity, I will create all entity class with OpenAccess ORM Domain Module wizad(I uncheck the option to generate context class). In DataAccess, I will create context class with OpenAccess ORM Conext wizad. The service will refer Entity and DataAccess project and provide some method to read/update data by calling method in DataAccess project. In WebUI project, it will only refer Enity and Service project. In my case, if I want to use OpenAccessLinqDataSource control in ASPX page, how can I map to my methods in service project in the control?  Because OpenAccessLinqDataSource wizad only can recognize generated Context class with OpenAccess ORM Conext wizad. Is there a way to mark some property in class and method in a normal project such as Service project in that case OpenAccessLinqDataSource can recognize those methods. The ASP.NET ObjectDataSource control also provide the feature. In most scenario, the OpenAccessLinqDataSource will not touch Context class directly.




  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 28 Aug 2012 Link to this post

    Hi Jin,

     The OpenAccessLiqnDataSource control is projected to work only directly against the context and to use its IQueryable<T> endpoints to perform Select operations against the database as well as the rest of the OpenAccessContext API for CUD operations. There is no way to bind custom methods for execution by the OpenAccessLinqDataSource as custom methods are intentionally meant to be executed by the .NET ObjectDataSource.

    All the best,
    Zoran
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
  4. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 28 Aug 2012 Link to this post

    Hi Zoran,

    In your case, the OpenAccessLiqnDataSource is not design for N-layer application, right? Because the UI will have no way to access context class in N-layer application. I think the OpenAccessLiqnDataSource is similar with Microsoft's SqlDataSource control, seem it's very simple and power to developer, but no actual useful in real project. My concern is why telerik develop a datasource control for N-layer application?



  5. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 31 Aug 2012 Link to this post

    Hello Jin,

     Actually the OpenAccessLinqDataSource control is much more similar to the EntityDataSource and LinqDataSource controls by Microsoft. These controls are tightly bound to Entity Framework and LinqToSql respectively, which are ORM frameworks very similar to OpenAccess. These kind of datasource controls are .NET standard in terms of datasources provided by and integrated with an ORM framework. N-Layer architecture can be interpreted in many ways by the developer and it is always possible to make some compromises in order to take advantage of some functionality like a datasource control. Have in mind that all datasource controls by ORM frameworks do require an access to their respective context objects. The context however can be part of the business layer in an N-Layer application so it can be visible to the UI for the purpose. Otherwise, using customer code in order to better separate the layers, automatically means the use of ObjectDataSource for the purpose, if any datasource is used.

    Kind regards,
    Zoran
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Back to Top