ServiceQuery.AzureDataTables 2.2.4

dotnet add package ServiceQuery.AzureDataTables --version 2.2.4
                    
NuGet\Install-Package ServiceQuery.AzureDataTables -Version 2.2.4
                    
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="ServiceQuery.AzureDataTables" Version="2.2.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ServiceQuery.AzureDataTables" Version="2.2.4" />
                    
Directory.Packages.props
<PackageReference Include="ServiceQuery.AzureDataTables" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ServiceQuery.AzureDataTables --version 2.2.4
                    
#r "nuget: ServiceQuery.AzureDataTables, 2.2.4"
                    
#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.
#:package ServiceQuery.AzureDataTables@2.2.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ServiceQuery.AzureDataTables&version=2.2.4
                    
Install as a Cake Addin
#tool nuget:?package=ServiceQuery.AzureDataTables&version=2.2.4
                    
Install as a Cake Tool

<img src="https://raw.githubusercontent.com/holomodular/ServiceQuery/main/Logo.png" title="ServiceQuery Logo" width="250"/>

NuGet version badge License: MIT

ServiceQuery: Dynamic Data Querying Over REST APIs

Overview

Welcome to ServiceQuery, the open-source library designed to revolutionize your data querying over REST APIs. Similar to OData and GraphQL, ServiceQuery harnesses the power of an expression builder and a straightforward model to serialize query instructions across service boundaries. It seamlessly supports a wide array of popular relational (SQL), document (NoSQL), cloud and embedded database engines, as well as in-memory lists. Front-end applications gain unprecedented querying capabilities through a standardized endpoint supporting polyglot data access across all database providers.

Get Started

Installation is simple:

Install the NuGet Package ServiceQuery

Why ServiceQuery?

  • Powerful: Provides front-end and back-end applications unprecedented dynamic querying capabilities with ease.
  • Secure: Utilizing the IQueryable interface, it builds dynamic LINQ expressions using individually mapped functions and parsed data, eliminating injection attacks.
  • Versatile: Supports numerous database engines including Azure Data Tables, Cosmos DB, MongoDB, MySQL, SQLite, SQL Server, PostgreSQL, Oracle, and many more.

Examples

Explore our Examples Repository for detailed implementations using the most popular database storage providers.

We Value Your Feedback

Join our discussion board to post any questions or issues. Don't forget to star our repository. For direct support, reach us at: Support@HoloModular.com

Dynamic Querying Made Easy

Here's how you can dynamically query data using JavaScript: Make sure to include the following ServiceQuery.js javascript file to quickly build request queries in javascript.

<script src="/js/servicequery.js"></script>
<script type="text/javascript">

  function GetById() {

    // Build the request where id = 123
    var request = new ServiceQueryRequestBuilder().IsEqual("Id","123").Build();

    // Send ajax request to REST Controller
    $.ajax({
        url: '/ExampleServiceQuery',
        data: JSON.stringify(request),
        type: "POST",
        dataType: 'json',
        headers: { 'Content-Type': 'application/json' },
        success: function (result) {

          // Output the response
          alert(result.list.length + ' records returned');
        }
    });
  }
</script>

On the server side, convert the request into IQueryable expressions and return the result (sync or async):

using ServiceQuery;

[HttpPost]
[Route("ExampleServiceQuery")]
public ServiceQueryResponse<ExampleTable> ExampleServiceQuery(ServiceQueryRequest request)
{
  var queryable = databaseContext.ExampleTable.AsQueryable();
  return request.Execute(queryable);
}

[HttpPost]
[Route("ExampleServiceQueryAsync")]
public async Task<ServiceQueryResponse<ExampleTable>> ExampleServiceQueryAsync(ServiceQueryRequest request)
{
  var queryable = databaseContext.ExampleTable.AsQueryable();
  return await request.ExecuteAsync(queryable);
}

Packages Available

The following NuGet packages are available for provider-specific implementations.

ServiceQuery.AzureDataTables

Support for Azure Data Tables (Storage Account) and async methods. Azure Data Tables has several limitations, such as lack of support for aggregate functions, string comparisons and ordering. This package provides a solution to these limitations, allowing you to use all standard operations and execute requests seamlessly. The solution downloads all records and then performs the query and unsupported functions using an internal list. See our example project for more information.

ServiceQuery.EntityFrameworkCore

Support for Microsoft Entity Framework Core (EFC) and async methods. Note: For the .NET 8 runtime, we reference EFC version 9. Use ServiceQuery.EntityFrameworkCore8 if you need EFC version 8.

ServiceQuery.EntityFrameworkCore8

Support for Microsoft Entity Framework Core (EFC) and async method. Note: This references EFC version 8 for the .NET 8 runtime.

ServiceQuery.MongoDb

Support for MongoDb and async methods.

Building and Executing a Query

Construct queries using the ServiceQueryRequestBuilder object:

using ServiceQuery;

public void Example()
{
  var request = new ServiceQueryRequestBuilder().Build();
  var queryable = databaseContext.ExampleTable.AsQueryable();
  
  var response = request.Execute(queryable); // sync support  
  var responseasync = await request.ExecuteAsync(queryable); // async support

  List<ExampleTable> list = response.List; // contains the list of objects returned from the query
  int? count = response.Count; // returns the count of the query (if requested)
  double? aggregate = response.Aggregate; // returns the aggregate value (if requested)
}

Supported Operations

Aggregate Functions

  • Average
  • Count
  • Maximum
  • Minimum
  • Sum

Comparison Functions

  • Between
  • Equal
  • Not Equal
  • Less Than
  • Less Than or Equal
  • Greater Than
  • Greater Than or Equal
  • In Set
  • Not In Set

Comparison Functions (string)

  • Contains
  • StartsWith
  • EndsWith

Grouping Functions

  • And
  • Or
  • Begin
  • End

Nullability Functions

  • Null
  • Not Null

Paging Functions

  • Page Number
  • Page Size
  • Include Count

Selecting Functions

  • Distinct
  • Select

Sorting Functions

  • Sort Ascending
  • Sort Descending

Using Query Operations

If you are using javascript, make sure to download the ServiceQuery.js javascript file. This allows you to use the same syntax as the .NET code below!

  using ServiceQuery;

  var request = new ServiceQueryRequestBuilder().Build();

  // This is the same as just a new object
  request = new ServiceQueryRequestBuilder()
    .Paging(1, 1000, false)
    .Build();

  // Include the count of records with the response
  request = new ServiceQueryRequestBuilder()
    .IsGreaterThan("id","10")
    .IncludeCount()
    .Build();

  // Select only the properties you want
  request = new ServiceQueryRequestBuilder()
    .Select("Id","FirstName","LastName")
    .Build();
  
  // Build AND expressions 
  request = new ServiceQueryRequestBuilder()
    .IsEqual("Id","1")
    .And()
    .StartsWith("FirstName", "John")    
    .Build();

  // Build OR expressions
  request = new ServiceQueryRequestBuilder()
    .Between("Id","1", "5")
    .Or()
    .Contains("LastName", "Smith")    
    .Build();

  // Group expressions with BEGIN, END, AND and OR. Nest as deeply as needed.
  request = new ServiceQueryRequestBuilder()
    .Begin()
      .IsEqual("Id","1")
      .And()
      .IsInSet("Status", "Created", "Open", "InProcess")
    .End()
    .Or()
    .Begin()
      .IsLessThanOrEqual("BirthDate","1/1/2000")
      .And()
      .IsNull("CloseDate")
    .End()
    .Build();

  // Sorting
  request = new ServiceQueryRequestBuilder()
    .IsEqual("Age", "21")
    .SortAsc("FirstName")
    .Build();

  // Aggregate functions
  request = new ServiceQueryRequestBuilder()
    .IsLessThan("Id", "200")
    .Sum("Price")
    .Build();

Working with DateTimes

When working with DateTimes, make sure to use the ToString format of "o" or "O" for proper datetime round-trip serialization, as in the following code:

var request = new ServiceQueryRequestBuilder()
    .IsLessThan("CreateDate", DateTimeOffset.UtcNow.ToString("o"))
    .Build();

ServiceQuery Options

Customize server-side query processing with ServiceQueryOptions object:

    public class ServiceQueryOptions
    {
        public Dictionary<string, string> PropertyNameMappings { get; set; }
        public bool PropertyNameCaseSensitive { get; set; }
        public bool AllowMissingExpressions { get; set; }
    }

Advanced Usage Scenarios

Manipulate queries before executing them

Add to, change or remove filters from incoming queries for business reasons.

Restrict properties by user roles

Adjust property mappings based on user role for security.

Sharding data

Add expressions to queries to target specific data segments, ensuring efficient data retrieval and enhanced security.

About

ServiceQuery is owned and maintained by HoloModular LLC and created by Danny Logsdon (Founder). Visit our websites at https://HoloModular.com, https://ServiceQuery.com or https://www.linkedin.com/in/danlogsdon to learn more.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ServiceQuery.AzureDataTables:

Package Downloads
ServiceBricks.Core

The open source microservices platform. Visit https://ServiceBricks.com to learn more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.4 0 12/23/2025
2.2.3 1,397 12/2/2025
2.2.2 115 7/19/2025
2.2.1 779 3/15/2025
2.2.0 763 12/24/2024
2.1.1 3,327 4/21/2024
2.1.0 208 4/14/2024
2.0.1 222 2/20/2024
2.0.0 199 2/13/2024
1.0.8 271 2/8/2024
1.0.6 267 7/7/2023
1.0.5 486 7/1/2023
1.0.4 241 6/30/2023