This is my static query
var results = from v in users
join d in orders on v.UserId equals d.UserId
join p in Products on d.ProductId equals p.ProductId
where v.UserName.Contains(UserName)
where v.FirstName.Equals(FirstName)
where v.ZipCity.Equals(ZipCity)
where v.OrderDate >= OrderDate && v.OrderDate < OrderDate
where p.ProductName.Equals(ProductName)
select v.Email, v.ShippingCity, v.TrackingNo;
I was looking at dynamic Linq and am trying to expand my feel on it. The above query is in a method called
GetOrder(string UserName, string FirstName, string ZipCity, DateTime OrderDate, ProductName)
Can I do this with Dynamic Linq, join to Products Table only if ProductName is not null in input parameter?
I was following this http://blog.bvsoftware.com/post/2008/02/27/How-to-create-a-Dynamic-LINQ-Query-Programmatically.aspx