This question is locked. New answers and comments are not allowed.
Basically I have the following linq query using OpenAccess
Dim products = (From pv In scope.Extent(Of DataModel.Productview)() _
Where pv.Dateadded = Date.Now _
Order By pv.Productviews Descending _
Select pv.Product).ToList
I have the equivilent using just Linq
Dim products = (From pv In db.productviews _
Where pv.Dateadded = Date.Now _
Order By pv.Productviews Descending _
Select pv.Product).ToList
I know that the database does not have any products that matches that criteria so I am expecting 0 in the product count. So if I try this
dim ProductCount as integer = products.count
This code will crash out using OpenAccess but I get the expected 0 count using just LINQ. Is there something I am missing out here? If I remove the where clause then it will work because there is data to retreive. What can I do to resolve this?
Also I have noticed that I can't do the following in OpenAccess
Dim products = (From pv In db.productviews _
Where pv.Dateadded = Date.Now.ToShortDateString _
Order By pv.Productviews Descending _
Select pv.Product).ToList
I am still debating whether to drop LINQ 2 SQL and go with OpenAccess but little problems like this really annoys me.Any help here would be appreciated.