This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Does lightspeed have its own syntax for querying multiple tables or do you have to use LINQ syntax. Your user guide only shows single table queries, thsu the question. select q.question_text, a.answer_text from questions q, answers a where a.question_id = q.question_id; Thanks |
|
|
Yes, you can use IUnitOfWork.Project to perform projections, which will return a DataReader which you can then extract the data from as required. Additionally you can use IUnitOfWork.Project<T> which will project the data into a known type using reflection. We have some documentation on this in the user guide: http://www.mindscapehq.com/documentation/lightspeed/Advanced-Querying-Techniques/Exploring-the-Query-Object If you are able to use LINQ for projections you will definitely find this much more convenient due to its support for anonymous type syntax. Internally the LINQ provider calls to IUnitOfWork.Project to perform any server side projections.
Jeremy |
|
|
Using the LINQ syntax is certainly the easiest way: var query = from c in UnitOfWork.Contributions You can do the same thing using query objects but it's a bit more laborious (see http://www.mindscapehq.com/documentation/lightspeed/Advanced-Querying-Techniques/Exploring-the-Query-Object for a starting point if you need to avoid LINQ).
|
|