public List <Aluno> Get(AlunoFiltro filtro) { List <Aluno> result = null; //using (DataAccess dataAccess = new DataAccess()) //{ // StringBuilder stringBuilder = new StringBuilder(); // stringBuilder.AppendLine("SELECT * FROM Aluno a"); // if (!string.IsNullOrEmpty(filtro.Nome)) // { // stringBuilder.AppendLine($"WHERE a.Nome LIKE '%{filtro.Nome}%'"); // } // result = dataAccess.Query(stringBuilder.ToString(), x => new Aluno // { // Id = (x["Id"] as int?).Value, // Nome = x["Nome"].ToString(), // DataNascimento = (x["Nascimento"] as DateTime?).Value // }); //} return(result); }
void CarregarDados(AlunoFiltro filtro) { //alunosDataGrid.ItemsSource = alunos = Business.Value.Get(filtro); //Lab.App.Data.EF.LabEF context = new Data.EF.LabEF(); //alunosDataGrid.ItemsSource = alunos = // context.Aluno.Select(x => new Aluno // { // Id = x.Id, // Nome = x.Nome, // DataNascimento = x.Nascimento // }).ToList(); //alunosDataGrid.Items.Refresh(); }