Using LINQ to Entities, I have the following code:
public Foo GetFooByID(int id)
{
return _db.Foo.First(m => m.ID == id);
}
public Bar GetBarByID(int id)
{
return _db.Bar.First(m => m.ID == id);
}
Is there a way to refactor this using generics?