Exemplo n.º 1
0
        public async Task <SearchResult> Get(SearchModel search)
        {
            var searchResult = new SearchResult();

            var startParam      = new SqlParameter("@Start", search.start);
            var pageSizeParam   = new SqlParameter("@PageSize", search.length);
            var keywordParam    = new SqlParameter("@Keyword", search.Keyword ?? string.Empty);
            var sortDirParam    = new SqlParameter("@SortDir", search.SortDir ?? string.Empty);
            var sortColumnParam = new SqlParameter("@SortColumn", search.SortColumn ?? string.Empty);

            var errors = await errorRepo.Get(
                "[dbo].[GetErrors] @Start, @PageSize, @Keyword, @SortDir, @SortColumn",
                startParam,
                pageSizeParam,
                keywordParam,
                sortDirParam,
                sortColumnParam);

            searchResult.Data = errors;

            return(searchResult);
        }