Exemplo n.º 1
0
        public GetTypesResponse GetTypes(GetTypesRequest request)
        {
            var types = new List<DSLNG.PEAR.Data.Entities.Type>();
            if (request.Take != 0)
            {
                types = DataContext.Types.OrderBy(x => x.Id).Skip(request.Skip).Take(request.Take).ToList();
            }
            else
            {
                types = DataContext.Types.ToList();
            }

            var response = new GetTypesResponse();
            response.Types = types.MapTo<GetTypesResponse.Type>();

            return response;
        }
Exemplo n.º 2
0
        public GetTypesResponse GetTypes(GetTypesRequest 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 GetTypesResponse
            {
                TotalRecords = totalRecords,
                Types = data.ToList().MapTo<GetTypesResponse.Type>()
            };
            //var types = new List<DSLNG.PEAR.Data.Entities.Type>();
            //if (request.Take != 0)
            //{
            //    types = DataContext.Types.OrderBy(x => x.Id).Skip(request.Skip).Take(request.Take).ToList();
            //}
            //else
            //{
            //    types = DataContext.Types.ToList();
            //}

            //var response = new GetTypesResponse();
            //response.Types = types.MapTo<GetTypesResponse.Type>();

            //return response;
        }