Hello Sebastian,
To get a good overview of some fundamental Telerik OpenAccess ORM features an capabilities, I suggest you the following documentation articles and videos:
- What is OpenAccess and how do you benefit from it? -
here
- How to implement the Model First scenario? -
article,
video
- How to create relationships between the classes in the model? -
here
- What is Round Trip scenario? -
here
- What is the OpenAccessContext? -
here
- How to execute CRUD operations? -
here
- Does OpenAccess support LINQ? -
here
- How to map CUD operations to stored procedures? -
article,
video
My suggestion about the steps to implement your idea is as follows:
1) Start to create the domain model using the Model First scenario
- Add classes in the model - you can drag the Domain Class item from the toolbox and drop it on the Visual Designer surface.
You will notice that the class is separated to three parts: properties, implementation and navigation. The first part contains those properties that correspond to the columns in the table to which the class is mapped. The second part consists of implementation properties. This type of properties is generated by OpenAccess when you implement some kind of inheritance. And the last part of the class is the navigational properties. They are created when you build the relationships between your classes.
For example: The classes Incident and Person are connected with 1 to Many association but Incident is not a parent of Person. So the structure of Incident will be: in properties you will have the scalar properties of the class, the implementation section will be empty and in the navigation section you will find a property of type IList<Person>, that will contain a list of all the persons connected to a given incident.
- Make the necessary settings for the class' properties (data types, primary keys and etc.)
- Create relationships between them (OpenAccess will generate the necessary navigation properties)
2) Map the classes to tables - you can use either
default or
explicit mapping
3) Generate CUD operations for the classes that need them
4) Migrate your model to the database
5) For other changes of the model use the steps described in the Round Trip scenario
Once your model is done you can execute CRUD operations using the generated context.
If you have additional questions or need help with the solution I provided, do not hesitate to get back to us.
Greetings,
Doroteya
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API.
Read more.