This is a migrated thread and some comments may be shown as answers.

OpenAccessLinqDataSource in N-layer application

3 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jin
Top achievements
Rank 1
Jin asked on 24 Aug 2012, 06:41 AM
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.




3 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 28 Aug 2012, 01:07 PM
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!
0
Jin
Top achievements
Rank 1
answered on 28 Aug 2012, 01:37 PM
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?



0
Zoran
Telerik team
answered on 31 Aug 2012, 08:53 AM
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!
Tags
General Discussions
Asked by
Jin
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Jin
Top achievements
Rank 1
Share this question
or