Skip to content

UniformQueries API

ElbyFross edited this page Jan 17, 2020 · 3 revisions

Remarks

A static class that provides and API for handling queries. Standardizes a way to build and handle queries.

  • Located at the UniformQueries namespace.
  • Requires setting a UniformQueries.dll as a reference.
  • Implements an API to converting a query to string format and back.
  • Provides an API for binding loaded IQueryHandler instances to the queries.

Query handlers

Loads a QueryHandlers property from loaded assemblies during a first call of API class.

Example

String-like query

The following example shows how to use a string-like query.

Query

user&logon&login=user1&password=pass123&guid=logon&os=anon&mac=anon&stamp=-8586223751007900162&token=BaOoEv2a10jG0JZMfCvzQZucoapP1tjt

The query contains string formated logon request with listed params: user, logon, login, password, guid, os, mac, stamp, token.

More about USER LOGON query you can find here

The following code shows two way to get an object data from the string query.

  • Converting directly to the Query isntance.
  • Receving an array of QueryPart objects.

C#

Query query = new Query(STRING_QUERY)
QueryPart[] parts = UniformQueries.API.DetectQueryParts(STRING_QUERY);
  • Where STRING_QUERY is a query in a string format.

Links

Related pages