Example #1
0
        public GetConversionsResponse GetConversions(GetConversionsRequest 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 GetConversionsResponse
            {
                TotalRecords = totalRecords,
                Conversions = data.ToList().MapTo<GetConversionsResponse.Conversion>()
            };

            //var conversions = DataContext.Conversions.Include(f => f.From).Include(t => t.To).ToList();
            //var response = new GetConversionsResponse();
            //response.Conversions = conversions.MapTo<GetConversionsResponse.Conversion>();

            //return response;
        }
Example #2
0
        public GetConversionsResponse GetConversions(GetConversionsRequest request)
        {
            var conversions = DataContext.Conversions.Include(f => f.From).Include(t => t.To).ToList();
            var response = new GetConversionsResponse();
            response.Conversions = conversions.MapTo<GetConversionsResponse.Conversion>();

            return response;
        }