GenericQueryEngine.DTOs 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package GenericQueryEngine.DTOs --version 1.0.0                
NuGet\Install-Package GenericQueryEngine.DTOs -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GenericQueryEngine.DTOs" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GenericQueryEngine.DTOs --version 1.0.0                
#r "nuget: GenericQueryEngine.DTOs, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GenericQueryEngine.DTOs as a Cake Addin
#addin nuget:?package=GenericQueryEngine.DTOs&version=1.0.0

// Install GenericQueryEngine.DTOs as a Cake Tool
#tool nuget:?package=GenericQueryEngine.DTOs&version=1.0.0                

How to Add QueryEngine

To use QueryEngine in your class, simply inject IQueryEngine it via the constructor like this:

public class JobService
{
    private readonly IQueryEngine _queryEngine;

    public JobService(IQueryEngine queryEngine)
    {
        _queryEngine = queryEngine;
    }
}

Example: Executing a Stored Procedure with QueryEngine

To execute a stored procedure using QueryEngine, follow the example below:

string storedProcedureName = "USP_GetJobLocations";

var jobLocations = await _queryEngine.ExecuteStoredProcedureAsync(
    storedProcedureName: storedProcedureName,
    parameters: new
    {
        JobTitle = "Software Engineer",
        IsRemote = true,
        LocationId = 123,
        DatabaseName = "cor_main",
    });

Example: Fetching Data with Filters and Aggregates using QueryEngine

To retrieve data from a table with filtering, pagination, order and aggregation, use the GetAsync method as shown below:

// Define the filters (e.g., filter orders by status and date range. AND with OR (Nested Conditions))
var filters = new FilterGroup
{
    LogicalOperator = "AND",
    Conditions = new List<object>
    {
        new FilterCondition { "OrderDate", (">=", DateTime.UtcNow.AddMonths(-3)) },
        new FilterCondition { "ProductCategory", ("IN", new[] { "Electronics", "Books" }) },
        new FilterGroup
        {
            LogicalOperator = "OR",
            Conditions = new List<object>
            {
                new FilterCondition { Column = "ProductCategory", Operator = "=", Value = "Electronics" },
                new FilterCondition { Column = "ProductCategory", Operator = "=", Value = "Books" }
            }
        }
    }
};

// Define the sorting columns (e.g., sort by OrderDate and CustomerName)
var orderByColumns = new List<string> { "OrderDate", "CustomerName" };

// Define pagination (page 1, 10 results per page)
var pageSize = 10;
var pageNumber = 1;

// Define the aggregate functions (e.g., calculate the total sum of TotalAmount)
var aggregates = new Dictionary<string, string>
{
    { "TotalAmount", "SUM" }  // Sum of the TotalAmount column
};

// Call GetAsync with all parameters
var queryResult = await _queryEngine.GetAsync(
    tableName: "Orders",   // The name of the table we're querying
    filters: filters,      // Filters to apply
    orderByColumns: orderByColumns,  // Sorting columns
    pageSize: pageSize,    // Results per page
    pageNumber: pageNumber,  // Page number to fetch
    aggregates: aggregates // Aggregate functions
);

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on GenericQueryEngine.DTOs:

Package Downloads
GenericQueryEngineTest

A library for executing dynamic queries and stored procedures with flexible filters.

GenericQueryEngine

A library for executing dynamic queries and stored procedures with flexible filters.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated