Exemplo n.º 1
0
        /// <inheritdoc/>
        public Dictionary <string, object> GetMeta()
        {
            if (_paginationContext.TotalResourceCount != null)
            {
                var    namingStrategy = _options.SerializerContractResolver.NamingStrategy;
                string key            = namingStrategy.GetPropertyName("TotalResources", false);

                _meta.Add(key, _paginationContext.TotalResourceCount);
            }

            if (_requestMeta != null)
            {
                Add(_requestMeta.GetMeta());
            }

            if (_resourceMeta != null)
            {
                Add(_resourceMeta.GetMeta());
            }

            return(_meta.Any() ? _meta : null);
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public Dictionary <string, object> GetMeta()
        {
            if (_options.IncludeTotalRecordCount && _pageService.TotalRecords != null)
            {
                _meta.Add("total-records", _pageService.TotalRecords);
            }

            if (_requestMeta != null)
            {
                Add(_requestMeta.GetMeta());
            }

            if (_resourceMeta != null)
            {
                Add(_resourceMeta.GetMeta());
            }

            if (_meta.Any())
            {
                return(_meta);
            }
            return(null);
        }