using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AlfredoLotar.Livro.Aspnet.SchoolModel;

public partial class SingleOrDefault : System.Web.UI.Page
{   
    protected void bntExecutar_Click(object sender, EventArgs e)
    {
        using (SchoolEntities contexto = new SchoolEntities())
        {
	        var query = contexto.Person.Where(t => t.FirstName.Contains("Roger")).Take(1).SingleOrDefault();              
                
	        dvProdutos.DataSource =  new Person[] { query };
	        dvProdutos.DataBind();
        }
    }
}