If I create a EntitiesModel.rlinq object from existring Database, whether the file need to put under DataAccess project? If so, whether UI also need to refer DataAccess project because the generated entity class is under EntitiesModel.rlinq?
5 Answers, 1 is accepted
Hi Jin,
In general OpenAccess ORM will be used in both your Entity Layer and as a Data Access layer. In fact, you can just merge those two layers in one project. OpenAccess can be integrated as a code generation solution so that you can define your classes in the Visual Designer or as Code-Only Fluent Mapping. OpenAccess will also generate for you an OpenAccessContext which will be used for any activities concerning the database (CRUD operations, stored procedure calls, etc.).
The best practice in your case is to add a Telerik OpenAccess Class Library to your solution. It will run the OpenAccess New Domain Model wizard that will guide you through the setup of the .rlinq file. Since you have already created your database, you can use the detailed description here to navigate within that process.
The OpenAccess New Domain Model wizard, however, won’t add references to the OpenAccessModel project in the other assemblies in your solution (if any already). You have to do this manually following these steps:
1) Go to the project that will use the model
2) Add a reference to the model project in it
3) Add references to Telerik.OpenAccess.dll and Telerik.OpenAccess.35.Extensions.dll too
4) Copy the connection string from the App.config file of the model project to the corresponding place in the configuration file of the project that will use it (if that project doesn’t contain a *.config file, copy the App.config file from the model project and paste it in it)
More details about that process are available here.
You can also check the Quick – Start Scenarios folder in our documentation to get a better overview on how to combine Telerik OpenAccess ORM with the different .Net User Interface Platforms.
Do not hesitate to get back to us if you have additional questions.
All the best,
the Telerik team
There is also an option to have the .rlinq file in one project, say the Entity Layer and the context class in another project, the DataAccess Layer for example. This way you will not have access from your UI layer to the database operations layer performed by the context. Have a look in this help article to get an overview about how this can be achieved.
Kind regards,Zoran
the Telerik team
In your case, how to auto generate method for store procedure if the entity and context class in two projects?
Please find the answer to this question here in the thread we discussed previously.
Kind regards,
Doroteya
the Telerik team