Class manipulation with EF:
ContextEF Contexto = new ContextEF();
public List<Cliente> Listar()
{
//var query = from c in Contexto.Cliente
// select c;
return Contexto.Cliente.ToList() ;
}
Onclick from the query page
protected void btnPesquisar_Click(object sender, EventArgs e)
{
ClientService service = new ClientService();
var lista = service.Listar();
gvListacEF.DataSource = lista;
gvListacEF.DataBind();
}
Error presented:
Error CS0012 The type 'Client' is defined in an assembly that is not referenced. You must add a reference to assembly 'DAO, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null'