public List<Product> ProductGetAll() { var db = new eBikesEntities(); return (from f in db.Product join pic in db.Picture on f.PictureId equals pic.PictureId select new Product() { Color = f.Color, Description = f.Description, ManufacturerId = f.ManufacturerId, Name = f.Name, PictureUrl = pic.Url, Price = f.Price, ProductId = f.ProductId }).ToList(); }
public Product ProductGetById(int productId) { var db = new eBikesEntities(); return (from f in db.Product where f.ProductId == productId join pic in db.Picture on f.PictureId equals pic.PictureId select new Product() { Color = f.Color, Description = f.Description, ManufacturerId = f.ManufacturerId, Name = f.Name, PictureUrl = pic.Url, Price = f.Price, ProductId = f.ProductId }).FirstOrDefault(); }