I\'m new in Linq and so I have these situation below.
Now below error during compilation, says Cannot implicitly convert type \'System.Linq.IQuery
When using var the compiler infers the type of the expression to the right of the assignment. When you write
var query = _db.Products;
query is of type DbSet, and it cannot be assigned any IQueryable, which the Where extension method returns.
When you used the query syntax, query was again IQueryable, which made it work. It's equivalent to writing
var query = products.Select(t => t);
The Select extension method, like Where, returns IQueryable.