I have the following simplified query(currently being returned from a stored procedure) that I want to use as the basis for a view for work in Entity Framework:
Select
cast (case when warehouse = @Warehouse then 1 else 0 end as bit) as AtThisWarehouse,
s.id as productStatusId
from products p
left join productstatus s on p.availiblity = s.cd;
Obviously I can't use a parameter in a view and don't want to use a stored procedure or user defined function since I want to follow current pattern in Entity Framework.
The Warehouse will be known and can be passed to be used in the where clause via filters but I am not sure how to leverage that fact to get back the results I want. Any suggestions on how to go about this?