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

How to integrate OpenAccess ORM to a existant project?

1 Answer 37 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Allin
Top achievements
Rank 1
Allin asked on 21 Sep 2012, 02:39 PM
I'm newbie with ORM and i want to know if it's possible to include OpenAcces ORM to a existing project with class and DB already created?

My goal, replaced current DB operation with OpenAccces ORM to be able to switch simply between SQL Server and Oracle DB with same DAL implementation. It's possible with this tool? Do you have sample project to explain this or others links with procedure to resolve case like this.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 24 Sep 2012, 02:11 PM
Hello Allin,

It is possible to plug OpenAccess ORM in such scenario. There are at least two approaches to achieve that:

1) In case your classes are rather simple (similar to the database entities), you can just create a Domain Model in a Database First manner, name the new classes properly in the designer either by naming rules or the Batch Operations dialog, and use the new classes instead. The old ones can be used as partial classes so that you won't have to move your business logic or any other additions.

2) In case the model is complex or you don't like the idea of replacing it, try using the Fluent Mapping. You can create a FluentMetadataSource, and define the mapping based on your existing entities.

I would recommend you to go with the Fluent Mapping, as we have recently released (in Q2 2012 SP2) some new features there allowing you to define your types in a generic way, so what you can switch your database more easily. You can find more details here. Without such definitions, changing the database would require some manual effort for applying the appropriate types.

Unfortunately we do not have a sample for this yet but we will be creating one in the near future. We do have samples for using Fluent Mapping, you can download and install the OpenAccess SDK to take a look at them.

Let us know if you have any other questions.

Greetings,
Ivailo
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
Data Access Free Edition
Asked by
Allin
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Share this question
or