Am a front-end dev. Let's get that out of the way... My issue is I need to get some data out of a few tables within the DB. The backend is written in C#. (I will try to answer questions on it if need be) which is not my area.
My SQL is just about average, I can understand enough to write the query that I need see below: (I've sanitized the table names)
SELECT *
FROM (SELECT * FROM table_1 UNION SELECT * FROM table_2) name
JOIN (SELECT OrderNo, ID FROM table_3 UNION SELECT OrderNo, ID from table_4) name_2
ON name.OrderNo = name_2.OrderNo
WHERE name_2 = <queryParam>
The difficult part is that I need to be able to run this query by varying search terms, by order number, by telephone number and by branch ID using linq.
Can anyone help and also point me in the direction of (preferably easy) resources to learn?