Thank you for your interest in Telerik OpenAccess ORM.
Generally, an example that may help you in the process you are starting is Telerik OpenAccess ORM 101 Linq Samples.
It is distributed with our Samples Kit
. There you can find a variety of Linq queries with a short description about their purpose, the SQL they produce and their result.
Regarding the stored procedure provided in the code snippet, I would suggest you the following translation:
(EntitiesModel dbContext =
comparison = dbContext.POSPaymentsDetail
.Where(paymentDetail => paymentDetail
.Branch == <value> && paymentDetail
.UniqueId == <value>)
.All(pDetail => pDetail.PostingStatus == "COMPLETE" && pDetail.PostingError == String.Empty);
IQueryable<POSTTransactionHeader> someHeaders = dbContext.POSTTransactionHeader.Where(th => th.Branch == <value> && th.UniqueID == <value>);
tHeader.PostingStatus = "COMPLETE";
} //Statement 3
For this stored procedure you will have three statements executed against the database. The first one would check whether the required condition is met, the second one would load the objects that need to be updated in the memory and the third one will persist the changes to the database.
Regarding your performance considerations, generally the LINQ queries are expected to be slower compared to the SQL ones, but those in the given stored procedure are relatively simple and the time for their execution should not become an issue.
Regarding your third question, about the update of the object, currently, OpenAccess requires the updated object to be loaded in memory (here
you can find details). However, we are working on a feature that will allow updates without prior loading and we are planning to release in the midst of this year with it.
I hope that works for you. If you have other questions or experience difficulties, do not hesitate to get back to us.
the Telerik team