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>
()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…