Generally, Telerik OpenAccess ORM allows you to implement a scenario where records are inserted directly in a join table (in a many-to-many relationship) without loading the related objects first. In order to meet this requirement you need to know the values of the keys in advance, and to perform a change in the model that will allow you to issue statements against the join table. Below you can find the recommended workflow:
1) Open the .rlinq file in Visual Designer
2) Delete the many-to-many association between the Posts
3) Open Model Schema Explorer
and expand the Tables
4) Find the PostTags
table and drag-and-drop it on the designer's surface.
5) Save the .rlinq file
At this point you can perform inserts in the PostTags
table as described here
Regarding the idea for the AddByKey()
method, I would strongly advise you to post it as a feature request on our Ideas and Feedback
portal. There the developers who use OpenAccess ORM can vote about it and once it gathers the approval of the community we are going to consider a place for it on our roadmap.
I hope this helps. If you need further assistance or have additional questions, do not hesitate to get back to us.
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features
shipped with our latest release!