Пример #1
0
        public async Task <IList <ProjectDto> > GetGrid(int page, int size)
        {
            var list = await _context.Projects.ToListAsync();

            var result = list.Skip(page * size).Take(size).ToList();

            return(ProjectMapper.Map(result));
        }
Пример #2
0
        public async Task <ProjectDto> GetById(long id)
        {
            var project = await _context.Projects.FirstOrDefaultAsync(a => a.Id == id);

            return(ProjectMapper.Map(project));
        }
Пример #3
0
        public async Task <IList <ProjectDto> > GetAll()
        {
            var list = await _context.Projects.ToListAsync();

            return(ProjectMapper.Map(list));
        }