Ejemplo n.º 1
0
 public QueryInstanceWrapper(QueryTemplate queryTemplate, IQuerier querier)
 {
     this._queryTemplate = queryTemplate;
     this._querier       = querier;
 }
Ejemplo n.º 2
0
 internal QueryInstance(QueryTemplate queryTemplate, IQuerier querier)
 {
     this._queryTemplate = queryTemplate;
     this._querier       = querier;
 }
Ejemplo n.º 3
0
 public static Task <IImmutableList <TResponse> > SearchAsync <TResponse>(this IQuerier <Search, IImmutableList <TResponse> > queryHandler, string text)
 {
     return(queryHandler.QueryAsync(new Search(text)));
 }
Ejemplo n.º 4
0
 public static Task <IImmutableList <TResponse> > GetAsync <TQuery, TResponse>(this IQuerier <Get <TQuery>, IImmutableList <TResponse> > queryHandler, IEnumerable <Id <TQuery> > ids)
 {
     return(queryHandler.QueryAsync(new Get <TQuery>(ids.ToImmutableList())));
 }
Ejemplo n.º 5
0
 public static QueryInstanceWrapper RunEQSQuery(QueryTemplate queryTemplate, IQuerier querier) => new QueryInstanceWrapper(queryTemplate, querier);
Ejemplo n.º 6
0
        public string Convert(string source, IQuerier data, Keywords keyword)
        {
            if (ValidateSource(source, keyword) == false)
            {
                throw new ArgumentException("Invalid source");
            }

            StringBuilder sb = new StringBuilder();

            string[] splitSource = GetSplitByForEach(source, keyword);

            for (int i = 0; i < splitSource.Length; i++)
            {
                if (i % 2 == 0)
                {
                    // Simple Add
                    string[] xpathSplit = splitSource[i].Split(new string[] { keyword.XPath }, StringSplitOptions.None);

                    for (int j = 0; j < xpathSplit.Length; j++)
                    {
                        if (j % 2 == 0)
                        {
                            sb.Append(xpathSplit[j]);
                        }
                        else
                        {
                            sb.Append(EscapeLaTeX(data.GetData(xpathSplit[j]).First()));
                        }
                    }
                }
                else
                {
                    string[] xpathSplit = splitSource[i].Split(new string[] { keyword.XPath }, StringSplitOptions.None);

                    IList <IEnumerator <string> > listEnum = new List <IEnumerator <string> >();

                    // Get odd ones
                    for (int j = 1; j < xpathSplit.Length; j += 2)
                    {
                        listEnum.Add(data.GetData(xpathSplit[j]).GetEnumerator());
                    }

                    while (MoveNext(listEnum))
                    {
                        for (int j = 0; j < xpathSplit.Length; j++)
                        {
                            if (j % 2 == 0)
                            {
                                sb.Append(xpathSplit[j]);
                            }
                            else
                            {
                                sb.Append(EscapeLaTeX(listEnum[j / 2].Current));
                            }
                        }
                    }

                    foreach (var enumerators in listEnum)
                    {
                        enumerators.Dispose();
                    }
                }
            }

            return(sb.ToString());
        }
Ejemplo n.º 7
0
 public AspNetCoreQuerier(IQuerier querier, IServiceProvider serviceProvider)
 {
     _querier         = querier;
     _serviceProvider = serviceProvider;
 }