Mercato.AspNet.OData.DataTableExtension
1.1.4-pre
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
<PackageReference Include="Mercato.AspNet.OData.DataTableExtension" Version="1.1.4-pre" />
paket add Mercato.AspNet.OData.DataTableExtension --version 1.1.4-pre
#r "nuget: Mercato.AspNet.OData.DataTableExtension, 1.1.4-pre"
// 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 | Versions 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. |
-
.NETStandard 2.0
- Microsoft.AspNet.OData (>= 7.1.0)
- Microsoft.AspNet.WebApi.Core (>= 5.2.2)
- Microsoft.OData.Edm (>= 7.5.0)
- Swashbuckle.Core (>= 5.6.0)
- System.Data.DataSetExtensions (>= 4.5.0)
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,449 | 1/25/2023 |
1.2.11 | 429 | 10/26/2022 |
1.2.10 | 519 | 11/8/2021 |
1.2.9 | 425 | 7/15/2021 |
1.2.8 | 364 | 7/8/2021 |
1.2.7 | 412 | 6/16/2021 |
1.2.6 | 410 | 6/14/2021 |
1.2.5 | 506 | 12/18/2020 |
1.2.4 | 481 | 12/17/2020 |
1.2.3 | 461 | 10/4/2020 |
1.2.2 | 451 | 9/21/2020 |
1.2.1 | 834 | 5/6/2020 |
1.2.0 | 478 | 5/4/2020 |
1.1.6 | 487 | 3/31/2020 |
1.1.5 | 518 | 2/13/2020 |
1.1.4-pre | 508 | 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