Having an DbContex
:
public class ProductsContext : DbContext
{
public DbSet<Product> Products;
}
I can do this:
Product product = _context.Products.Find(1);
I want to do that in an generic way
IDbSet<T> set = _context.Set<T>();
T entity = set.Find(1);
There are any Entity Framework related performance difference between the two or is the same thing?