Mercato.AspNet.OData.DataTableExtension 1.1.4-pre

This is a prerelease version of Mercato.AspNet.OData.DataTableExtension.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Mercato.AspNet.OData.DataTableExtension --version 1.1.4-pre
NuGet\Install-Package Mercato.AspNet.OData.DataTableExtension -Version 1.1.4-pre
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="Mercato.AspNet.OData.DataTableExtension" Version="1.1.4-pre" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mercato.AspNet.OData.DataTableExtension --version 1.1.4-pre
#r "nuget: Mercato.AspNet.OData.DataTableExtension, 1.1.4-pre"
#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 Mercato.AspNet.OData.DataTableExtension as a Cake Addin
#addin nuget:?package=Mercato.AspNet.OData.DataTableExtension&version=1.1.4-pre&prerelease

// Install Mercato.AspNet.OData.DataTableExtension as a Cake Tool
#tool nuget:?package=Mercato.AspNet.OData.DataTableExtension&version=1.1.4-pre&prerelease

Mercato.AspNet.OData.DataTable

Adds support for OData query syntax over ADO.Net DataTables in WebApi projects.

This is an initial implementation to allow for core functionality in cases where there is no fixed structure for the datatable at design time, meaning that use of the standard Microsoft.AspNet.OData nuget is precluded by the lack of a fixed EdmModel or underlying Entity source.

The implementation as it stands currently supports the following elements of the OData syntax:

  • $filter - supporting all standard operators with the exception of has
  • $select - not including support for $expand as there is no concept of related entities
  • $top
  • $skip
  • $orderby

At the time of writing there is no support for functions implemented

Usage

Getting Started

Install-Package Mercato.AspNet.OData.DataTableExtension

This will install the standard Microsoft OData dependencies

OData Initialisation

To correctly intitialise the OData parsing for your API project add the following to your startup:

using Microsoft.AspNet.OData.Extensions;

...

        public static void Register(HttpConfiguration config)
        {
            config.EnableDependencyInjection();

			...
        }


In your controller, once you have your populated DataTable:

using Mercato.AspNet.OData.DataTableExtension;
...

            DataTable BaseData = ....;

            DataTable Output = BaseData.ApplyODataQuery(Request);

##Swagger Support##

The class ODataParametersSwaggerDefinition adds support for indicating the supported OData parameters in OpenApi (Swagger) documentation using Swashbuckle.

The class implements the IOperationFilter interface to allow use according to the Swashbuckle documentation. In addition a static method is exposed to allow for direct addition of the parameters if building the operation representations manually.

using Mercato.AspNet.OData.DataTableExtension;

…

            Swashbuckle.Swagger.Operation TargetOperation = ….;
            ODataParametersSwaggerDefinition.AppendOdataParametersToOperation(TargetOperation);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.12 2,287 1/25/2023
1.2.11 425 10/26/2022
1.2.10 518 11/8/2021
1.2.9 424 7/15/2021
1.2.8 363 7/8/2021
1.2.7 411 6/16/2021
1.2.6 409 6/14/2021
1.2.5 504 12/18/2020
1.2.4 479 12/17/2020
1.2.3 459 10/4/2020
1.2.2 448 9/21/2020
1.2.1 832 5/6/2020
1.2.0 477 5/4/2020
1.1.6 486 3/31/2020
1.1.5 517 2/13/2020
1.1.4-pre 507 6/26/2019

v1.1.1 - ODataParametersSwaggerDefinition class added to aid adding OData parameter information via Swashbuckle
v1.0.1 - Simplified extension method added for DataTable