In Sql, let's say I have the following procedure
GetCars
(
@Ids nvarchar(MAX) = NULL // represent a list of Id (with comma)
@TypeIds nvarchar(MAX) = NULL // represent a list of TypeId (with comma)
)
// After transforming my Ids and TypeIds into CSVTABLE (comma seperated values table)
SELECT * FROM CARS
WHERE ((@Id IS NULL) OR ( CARS.Id IN (SELECT Id FROM CSVTABLE)) AND
((@TypeId IS NULL) OR (CARS.TypeId IN (SELECT ID FROM CSVTABLE)))
Is is possible to transform this sql queries into a Linq?