Active Query Builder Web API

Client for .NET

Download the client for .NET

You can download the ready-to-use client for .NET using the "Download now" link below or install the package from the public repository. Using the package will let you keep the client up-to-date. Full source code is available at GitHub.

Direct Download

Download Active Query Builder Web API Client for .NET:

Download now

Install using NuGet

Use NuGet package manager to add Active Query Builder Web API Client to your .NET project:

Install-Package WebApi.ActiveQueryBuilder
NuGet package

Source code on GitHub

Download and review source code of Active Query Builder Web API Client for .NET on GitHub

Source on Github
Getting started with the client for .NET
Create a new API provider
ActiveQueryBuilderApi api = new ActiveQueryBuilderApi()
Create a new Transform object
Transform transform = new Transform
    Guid = "9dbd355e-360e-430e-9cca-df6dd8b6d8d1", //Metadata Guid from dashboard
    Sql = "select id, name from Person" //Initial sql query
Add totals calculation
Totals max = new Totals { Field = "id", Totals.AggregateEnum.Max };
Totals min = new Totals { Field = "id", Totals.AggregateEnum.Min };

transform.Totals = new List<Totals> { max, min };
Define pagination
Pagination page = new Pagination { Skip = 2, Take = 3 };

transform.Pagination = page;
Setup sorting
Sorting asc = new Sorting { Field = "id", Sorting.OrderEnum.Asc };
Sorting desc = new Sorting { Field = "name", Order = Sorting.OrderEnum.Desc };

transform.Sortings = new List<Sorting> { asc, desc };
Apply filters
ConditionGroup filter = new ConditionGroup();

Condition Condition = new Condition { 
    Field = "id", 
    ConditionOperator = Condition.ConditionOperatorEnum.Between, 
    Values = new List<string> { "1", "5" } 

filter.Conditions = new List<Condition> { condition };

transform.Filter = filter;
Hide some columns
HiddenColumn column = new HiddenColumn { Field = "name" };

transform.HiddenColumns = new List<HiddenColumn> { column };
Send request to the API
TransformResult result = api.TransformSQLPost(transform);
string transformedSql = result.Sql;
Get list of query columns
SqlQuery query = new SqlQuery
    Guid = "9dbd355e-360e-430e-9cca-df6dd8b6d8d1", //Metadata Guid from dashboard
    Text = "select id, name from Person" //Initial sql query

List<QueryColumn> columns = api.GetQueryColumnsPost(query)