예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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]);
 }
예제 #6
0
 public static string GetMethod(QueryMethodType id) => QueryMethodMapping.ContainsKey(id) ? QueryMethodMapping[id] : null;