public ActionResult <IEnumerable <Team> > Get()
        {
            var Teams = db.Set <Team>().OrderBy(p => p.Id).Take(10).ToList();

            return(Ok(Teams));
        }
        public ActionResult <IEnumerable <Person> > Get()
        {
            var people = db.Set <Person>().Include(p => p.Team).OrderBy(p => p.Id).Take(10).ToList();

            return(Ok(people));
        }
示例#3
0
 public virtual async Task <T> GetByIdAsync(long id)
 {
     return(await _dbContext.Set <T>().FindAsync(id));
 }