using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Where1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnExecutar_Click(object sender, EventArgs e)
    {
        using (NorthwindDataContext db = new NorthwindDataContext())
        {
            var produtos = (from p in db.Products
                            where p.CategoryID == 1
                            select new { p.ProductID, p.ProductName, p.UnitsInStock }).Where(x => x.UnitsInStock > 25);
            GridView1.DataSource = produtos;
            GridView1.DataBind();
        }
    }
}

/*
var produtos = from p in db.Products
	where p.CategoryID == 1 && p.UnitsInStock > 25
	select new {p.ProductID, p.ProductName, p.UnitsInStock };
*/


/*
var produtos = (from p in db.Products
	select new {p.CategoryID, p.ProductID, p.ProductName, p.UnitsInStock }).Where(x => x.UnitsInStock > 25 && x.CategoryID == 1);
*/