LINQ

Snippet

//linq join example

query = (from prod in objProductList

                             join catg in lstCategory

                             on prod.CategoryId equals catg.Id

                             join covr in lstCoverType

                             on prod.CoverTypeId equals covr.Id

                             select new Product

                             {

                                 Id = prod.Id,

                                 Title = prod.Title,

                                 Description = prod.Description,

                                 ISBN = prod.ISBN,

                                 Author = prod.Author,

                                 Price = prod.Price,

                                 ImageURL = prod.ImageURL,

                                 CategoryName = catg.Name,

                                 CoverTypeName = covr.Name

 

                             }).ToList();