Get all rows using entity framework dbset

Set<T>() is already IQueryable<T> and it returns all rows from table

public IQueryable<Company> GetCompanies()
{
    return DbContext.Set<Company>();    
}

Also generated DbContext will have named properties for each table. Look for DbContext.Companies – it’s same as DbContext.Set<Company>()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)