If you already have a database and a business objects layer defined, there are two options for you with Telerik OpenAccess ORM:
1) You can remove the persistence and navigational properties from the existing objects, make them partial and design a Domain Model through reverse-mapping your database
. You need to make sure that:
- the class names are the same as yours - you need to rename the Domain Classes in the Visual Designer where necessary
- the code generation of the model is configured to place the auto-generated classes in the same assembly as your existing classes (because of the partial classes linkage). However, you can keep the same namespace structure
For more information regarding this separation of business logic and persistence properties in different classes you can refer to the relevant documentation article
2) You can take the Code Only approach by using our Fluent Mapping API
. This way you define your mapping declaratively in your code, so it will give you the most flexibility. However, have in mind that you will not be able to use the Visual Designer for a visual representation of your model..
In general I recommend you the second, Code Only approach, despite that it might seem like a lot of coding. It is more straight-forward and it is less likely for you to stumble into difficult mapping situations than while using the less flexible Visual Designer approach.
As per your second question, the only separation that can currently be achieved with the Visual Designer approach (1) is separating the OpenAccessContext
from the generated classes. The Fluent Mapping API (2) would give you more flexibility since its entirely your code that defines the mapping.
Do not hesitate to let us know if you need further assistance.
the Telerik team
Want to use Telerik OpenAccess with SQL Azure? Download
the trial version today.