I have 2 methods of a generic repository
public TEntity ObterPorId(int id)
{
return Db.Set<TEntity>().Find();
}
public IEnumerable<TEntity> ObterTodos()
{
return Db.Set<TEntity>().ToList();
}
But I want to use Dapper, to get a little more performance, because the ObterTodos
method of Entity is taking a long time to bring the data.
How can I do this using Dapper?