Пример #1
0
        public static SearchCommand <T> Expand <T>(this SearchCommand <T> command, string expression)
        {
            if (command.SearchParameters != null && command.SearchParameters is IExpandable expandableParams)
            {
                expandableParams.Expand.Add(expression);
            }

            return(command);
        }
Пример #2
0
        public static SearchCommand <T> Expand <T>(this SearchCommand <T> command, Expression <Func <T, Reference> > expression)
        {
            if (command.SearchParameters != null && command.SearchParameters is IExpandable expandableParams)
            {
                expandableParams.Expand.Add(new Expansion <T>(expression).ToString());
            }

            return(command);
        }
Пример #3
0
        public static void SetStaged <T>(this SearchCommand <T> command, bool staged)
        {
            if (command.AdditionalParameters == null)
            {
                command.AdditionalParameters = new ProductProjectionAdditionalParameters();
            }

            if (command.AdditionalParameters is ProductProjectionAdditionalParameters parameters)
            {
                parameters.Staged = staged;
                return;
            }

            throw new ArgumentException("AdditionalParameters not of type ProductProjectionAdditionalParameters");
        }
Пример #4
0
        public static SearchCommand <T> Expand <T>(this SearchCommand <T> command, string expression)
        {
            command.Expand.Add(expression);

            return(command);
        }
Пример #5
0
        public static SearchCommand <T> Expand <T>(this SearchCommand <T> command, Expression <Func <T, Reference> > expression)
        {
            command.Expand.Add(new Expansion <T>(expression).ToString());

            return(command);
        }