QueryBuildersDotNET 1.0.5

.NET Standard 2.0 .NET Framework 4.0
There is a newer version of this package available.
See the version list below for details.
Install-Package QueryBuildersDotNET -Version 1.0.5
dotnet add package QueryBuildersDotNET --version 1.0.5
<PackageReference Include="QueryBuildersDotNET" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QueryBuildersDotNET --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: QueryBuildersDotNET, 1.0.5"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install QueryBuildersDotNET as a Cake Addin
#addin nuget:?package=QueryBuildersDotNET&version=1.0.5

// Install QueryBuildersDotNET as a Cake Tool
#tool nuget:?package=QueryBuildersDotNET&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

QueryBuilders.NET

SQL query builders for the .NET framework

Example

string region = "RJ";
string city = "Rio de Janeiro";
bool readReportsTo = true;

SelectQueryBuilder builder = new SelectQueryBuilder();
builder.AddFrom("orders");
builder.AddField("orders.orderid");
builder.AddField("orders.customerid");
builder.AddField("orders.employeeid");
builder.Where.Add("orders.shipregion = {0}", region);
builder.Where.AddEqualsObject("orders.shipcity", city);
builder.AddOrderBy("orders.orderid", true);
if (readReportsTo)
{
    builder.AddJoin("employees").On.Add("orders.employeeid = employees.employeeid");
    builder.AddField("employees.reportsto");
}
Console.WriteLine(builder);
// SELECT orders.orderid, orders.customerid, orders.employeeid, employees.reportsto
// FROM orders
// INNER JOIN employees ON orders.employeeid = employees.employeeid
// WHERE orders.shipregion = @p_0 AND orders.shipcity = @p_1
// ORDER BY orders.orderid ASC

using (IDbCommand command = connection.CreateCommand())
{
    // Sets the CommandText property, as well as values for p_0 and p_1 parameters
    builder.PrepareDbCommand(command);
    using (var reader = command.ExecuteReader())
    {
        while (reader.Read())
        {
            // Read rows...
        }
    }
}

// Also integrates with Dapper using the QueryBuildersDotNet.Dapper package
var results = connection.Query(builder);
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on QueryBuildersDotNET:

Package Downloads
QueryBuildersDotNET.Dapper

Provides multiple methods to integrate QueryBuilders.NET with the Dapper micro-orm

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 6,993 3/19/2020
1.0.5 2,610 5/17/2019
1.0.4 453 4/2/2019
1.0.3 611 12/8/2018
1.0.2 525 12/4/2018