Commit 9a39980a authored by Sebastian Barbosa's avatar Sebastian Barbosa
Browse files

Desarollo metodo get EF

parent e5b0af7e
......@@ -31,7 +31,25 @@ namespace DataAccessLayer
public Employee GetEmployee(int id)
{
throw new NotImplementedException();
using (var context = new Model.tsi_pr1Entities())
{
// http://www.dreamincode.net/forums/topic/329803-creating-an-easy-data-access-layer-using-entity-framework/
var result = from emp in context.Employees
where emp.Id == id
select emp;
Model.Employee employee = result.FirstOrDefault(null);
/*var result = context.Employees.Find(id);*/
//TODO: Ver como hago para mapear el Model.Employee que me retorna esa query (o mas bien la lista) a un Shared.Entities.Employee, part o full time
// No se si tengo que hacer el "if" a mano y crear los objetos a mano o se hace a travez de algun helper o algo
throw new NotImplementedException();
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment