Which is the best practice in getting data from repository? passing just by object or by Id?
public IQueryable<Attendance> GetByPersonId(int id)
{
return DbSet.Where(ps => ps.PersonId == id);
}
or
public IQueryable<Attendance> GetByPerson(Person person)
{
return DbSet.Where(ps => ps.Person == person);
}
Are there any performance implication? Or is it a case to case basis? If so what are the cases that you might want to pass by object and not by Id?