Пример #1
0
        public object Get(GetOnlyValues request)
        {
            var query = AutoQuery.CreateQuery(request, Request);

            return(WithDb(db =>
            {
                if (!string.IsNullOrWhiteSpace(request.CatalogType))
                {
                    var catalogDefinition = db.Single <CatalogDefinition>(e => e.Name == request.CatalogType);
                    if (catalogDefinition != null)
                    {
                        query.Where(e => e.CatalogDefinitionId == catalogDefinition.Id);
                    }
                    else
                    {
                        throw new Exception($"Catalog does not exist: [{request.CatalogType}]");
                    }
                }

                CommonResponse commonResponse = Logic.GetPaged(
                    request.Limit,
                    request.Page,
                    request.FilterGeneral,
                    query,
                    requiresKeysInJsons: request.RequiresKeysInJsons
                    );
                var result = commonResponse.Result as List <Catalog>;
                return result.Select(e => e.Value);
            }));
        }
Пример #2
0
        public object Get(GetOnlyValues request)
        {
            var query = AutoQuery.CreateQuery(request, Request);

            return(WithDb(db =>
            {
                CommonResponse commonResponse = Logic.GetPaged(
                    request.Limit,
                    request.Page,
                    request.FilterGeneral,
                    query,
                    requiresKeysInJsons: request.RequiresKeysInJsons
                    );

                var result = commonResponse.Result as List <Catalog>;
                return result.Select(e => e.Value);
            }));
        }
Пример #3
0
 public object Get(GetOnlyValues request)
 {
     return(WithDb(db => Logic.GetOnlyValues(request.Type)));
 }