Exemple #1
0
        /// <summary> Adds specified method to last node in SingleQuery </summary>
        /// <param name="singleQuery"></param>
        /// <param name="type">Method type to add</param>
        /// <param name="actions"></param>
        /// <returns></returns>
        public static SingleQuery AddMethod(this SingleQuery singleQuery, QueryMethodType type,
                                            params Action <QueryNode>[] actions)
        {
            var newNode = singleQuery.NodesList.Last.AddMethod(type, actions);

            return(singleQuery);
        }
        private QueryMethod GetQueryMethod(AzureQuery query, QueryMethodType type)
        {
            foreach (var method in query.Methods)
            {
                if (method.MethodType == type)
                {
                    return(method);
                }
            }

            return(null);
        }
Exemple #3
0
        public static QueryNode CreateMethod(QueryMethodType type, params Action <QueryNode>[] actions)
        {
            var queryNode = new QueryNode
            {
                Type       = QueryNodeType.Method,
                MethodType = type,
            };

            actions?.ForEach(x => x.Invoke(queryNode));

            return(queryNode);
        }
Exemple #4
0
        /// <summary> Adds specified method to specified node in SingleQuery </summary>
        /// <param name="node"></param>
        /// <param name="type">Method type to add</param>
        /// <param name="actions"></param>
        /// <returns></returns>
        public static LinkedListNode <QueryNode> AddMethod(this LinkedListNode <QueryNode> node, QueryMethodType type,
                                                           params Action <QueryNode>[] actions)
        {
            var queryNode = CreateMethod(type, actions);

            var newNode = node.List.AddLast(queryNode);

            return(newNode);
        }
Exemple #5
0
 /// <summary> Get query language token id by QueryMethodType </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static int GetToken(QueryMethodType type)
 {
     return(QueryMethodTypeToToken[type]);
 }
Exemple #6
0
 public static string GetMethod(QueryMethodType id) => QueryMethodMapping.ContainsKey(id) ? QueryMethodMapping[id] : null;