How to use Generic Method with Dapper?

1

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?

    
asked by anonymous 22.03.2016 / 03:44

1 answer

1

See this article from Poliana Dias, elá is developing a project on GitHub with Dapper, there is an example of a generic method.

The project is right at the beginning, easy to understand and follow ..

link

OR directly in GH link

    
20.05.2016 / 21:18