EF Core 2.0 Generic DbSet does not have method AsNoTracking

I am trying to implement a Generic repository as described in https://codingblast.com/entity-framework-core-generic-repository/

It seems the generic DbSet does not have implemention for method AsNoTracking( ), am i not using the correct syntax? How to fix this issue

public class BaseRepository<TEntity> : IGenericRepository<TEntity>
    where TEntity : class
{
    private readonly DbContext _dbContext;
    public BaseRepository(DbContext dbContext)
    {
        _dbContext = dbContext;
    }

    public IQueryable<TEntity> GetAll()
    {
        return _dbContext.Set<TEntity>().AsNoTracking();
    }

   }

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image