Entity Framework - Selecting specific columns
I have a successful query that links two tables with a where and orderby clause, but I wanted to add to just select specific columns instead of getting everything back. PART 1 When I attempt this I get syntax errors on the orderby line, if I remove the orderby line the syntax errors move to the where line. Error 3 Cannot implicitly convert type 'System.Linq.IOrderedQueryable' to 'System.Linq.IQueryable'. An explicit conversion exists (are you missing a cast?) IQueryable<VendorProfile> query = _db.VendorProfiles .Include("VendorCategories") .Include("VendorsSelected") .Select(s => new { s