I'm going through the ORM tutorial and I notice that much is made of persistent classes. Can someone tell me what this means and how it relates to how OpenAccess functions?
Thanks - Randy
1 Answer, 1 is accepted
0
Accepted
PetarP
Telerik team
answered on 31 Aug 2009, 12:45 PM
Hello Randy Minder,
Telerik OpenAccess ORM uses the persistent classes to "communicate" with the database. Your database tables are represented by the persistent classes in your application. Every class that is marked with the [Persistent] attribute can be persisted to the database. So lets say that you have a class called Order and this class is marked as Persistent. Whenever you create new order in your application and add it to the object scope, this new order will be added to the database in the corresponding table (in our case Orders). Here is an example:
scope.Transaction.Begin();
Order ord = new Order(){ Freight=100, ShipCity="sofia"};