Пример #1
0
 public GetGroupsResponse GetGroups(GetGroupsRequest request)
 {
     var response = new GetGroupsResponse();
     var groups = DataContext.Groups.ToList();
     response.Groups = groups.MapTo<GetGroupsResponse.Group>();
     return response;
 }
Пример #2
0
        public GetGroupsResponse GetGroups(GetGroupsRequest request)
        {
            int totalRecords;
            var data = SortData(request.Search, request.SortingDictionary, out totalRecords);
            if (request.Take != -1)
            {
                data = data.Skip(request.Skip).Take(request.Take);
            }

            return new GetGroupsResponse
            {
                TotalRecords = totalRecords,
                Groups = data.ToList().MapTo<GetGroupsResponse.Group>()
            };
            //var response = new GetGroupsResponse();
            //var groups = DataContext.Groups.ToList();
            //response.Groups = groups.MapTo<GetGroupsResponse.Group>();
            //return response;
        }