/// <summary>
        /// Gets the CSS variables.
        /// </summary>
        /// <param name="variableQueryParams">The variable query parameters.</param>
        /// <returns></returns>
        public async Task <List <VariableDTO> > GetCssVariables(VariableQueryParams variableQueryParams)
        {
            var variables = FindAll();

            var pagedVariables = variables
                                 .Skip((variableQueryParams.PageNumber - 1) * variableQueryParams.PageSize)
                                 .Take(variableQueryParams.PageSize)
                                 .Include(x => x.Menu);

            var mappedVariables = pagedVariables
                                  .ProjectTo <VariableDTO>(_mapper.ConfigurationProvider).ToList();

            return(await Task.FromResult(mappedVariables));
        }
示例#2
0
        public async Task <IActionResult> GetCssVariables([FromQuery] VariableQueryParams variableQueryParams)
        {
            var result = await _cssVariableService.GetCssVariables(variableQueryParams);

            return(StatusCode((int)result.Code, result.Value));
        }
示例#3
0
        /// <summary>
        /// Gets css variables
        /// </summary>
        /// <param name="variableQueryParams">The variable query parameters.</param>
        /// <returns></returns>
        public async Task <CSSResponse> GetCssVariables(VariableQueryParams variableQueryParams)
        {
            var menus = await _repository.CssVariable.GetCssVariables(variableQueryParams);

            return(new CSSResponse(menus, HttpStatusCode.OK));
        }