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
|
Lightspeed 4.0 - I have the following DB tables (simplified): Equipment { id, name } ProductCategory { id, name, regionCultureId } EquipmentProductCategory { id, equipmentId, productCategoryId } I have the following type of query going on: var equipment = base.UnitOfWork.Equipment.Where(e => e.id = SomeGuid); Which gives me a nice list of the equipment row I want along with all of the product categories in the database that are associated to that equipment - at which point I then need to manually loop over the product categories and only use the ones that match a particular regionCultureId... Is there a way (with or without linq) to have lightspeed only return me the matching equipment (by id) along with only the product categories that are FK'd to it with a particular region culture id? The SQL for it would be like this: select * from equipment e join equipmentproduccategory epc on e.id = epc.equipmentid join productcategory pc on epc.productcategoryid = pc.id and pc.regioncultureid = 'someguid' |
|
|
The following should translate to the SQL you just mentioned:
And then you work with the results from there which would be the same as dealing with the result set if you executed that SQL manually. Is that what you were looking to achieve?
|
|