Exemple #1
0
        /// <summary>
        /// Get Paginated items.
        /// </summary>
        /// <param name="pageModel">the PagingParameterInModel. Must not be null.</param>
        /// <param name="orderBy">an optionnal orderByClause.</param>
        /// <returns>The corresponding borders paginated an optionnaly</returns>
        public async Task <PagingParameterOutModel <HRBorder> > GetBordersAsync(PagingParameterInModel pageModel, HRSortingParamModel orderBy = null)
        {
            PagingParameterOutModel <HRBorder> retour = null;

            if (_workflow == null)
            {
                if (_logger != null)
                {
                    _logger.LogError("_workflow is null in HRCoreBordersServices");
                }
                throw new MemberAccessException();
            }
            if (pageModel == null)
            {
                if (_logger != null)
                {
                    _logger.LogError("pageModel is null in HRCoreBordersServices : GetBordersAsync");
                }
                throw new ArgumentNullException();
            }
            using (Task <PagingParameterOutModel <HRBorder> > retourTask = _workflow.GetQueryResultsAsync(pageModel, orderBy))
            {
                await retourTask;
                retour = retourTask.Result;
            }
            return(retour);
        }
Exemple #2
0
        /// <summary>
        /// TODO
        /// </summary>
        /// <param name="pageModel"></param>
        /// <param name="orderBy"></param>
        /// <returns></returns>
        public async Task <PagingParameterOutModel <HRCountry> > GetCountriesAsync(PagingParameterInModel pageModel, HRSortingParamModel orderBy)
        {
            if (_workflow == null)
            {
                throw new MemberAccessException();
            }
            Task <PagingParameterOutModel <HRCountry> > retourTask = _workflow.GetQueryResultsAsync(pageModel, orderBy);
            await retourTask;

            return(retourTask.Result);
        }