Exemplo n.º 1
0
        public GetGeneralResponse <IEnumerable <CodeView> > GetCodes(int pageSize, int pageNumber, IList <Sort> sort)
        {
            GetGeneralResponse <IEnumerable <CodeView> > response = new GetGeneralResponse <IEnumerable <CodeView> >();

            try
            {
                int index = (pageNumber - 1) * pageSize;
                int count = pageSize;

                Response <Code> codesResponse = _codeRepository.FindAllWithSort(index, count, sort);
                response.data       = codesResponse.data.ConvertToCodeViews();
                response.totalCount = codesResponse.totalCount;
            }
            catch (Exception ex)
            {
                response.ErrorMessages.Add(ex.Message);
            }

            return(response);
        }