DigitaleDelta.ODataWriter
1.0.2
dotnet add package DigitaleDelta.ODataWriter --version 1.0.2
NuGet\Install-Package DigitaleDelta.ODataWriter -Version 1.0.2
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="DigitaleDelta.ODataWriter" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DigitaleDelta.ODataWriter" Version="1.0.2" />
<PackageReference Include="DigitaleDelta.ODataWriter" />
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 DigitaleDelta.ODataWriter --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DigitaleDelta.ODataWriter, 1.0.2"
#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 DigitaleDelta.ODataWriter@1.0.2
#: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=DigitaleDelta.ODataWriter&version=1.0.2
#tool nuget:?package=DigitaleDelta.ODataWriter&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DigitaleDelta.ODataWriter
A lightweight .NET library for generating OData-compliant JSON responses with support for pagination, property selection, and entity serialization.
Features
- Fluent builder pattern for constructing OData responses
- Support for pagination with skip tokens
- Property selection ($select)
- Count metadata
- Entity set context handling
- Clean JSON serialization
- Zero external dependencies beyond .NET standard libraries
Usage
Basic example:
var mapper = ODataPropertyMapper.CreateMapper(typeof(WeatherStation), excludeNulls: true);
var entities = new List<WeatherStation>
{
new() { Location = "Loc1", StationId = null, Temperature = 20 },
new() { Location = "Loc2", StationId = "Id2", Temperature = 30 }
} .Select(mapper);
var selectedProperties = new List<string> { "stationId", "location" };
var response = entities
.CreateODataResponse()
.WithBaseUrl("https://api.example.com")
.WithEntitySet("weatherstations")
.WithPagination(new SkipTokenInfo(), top: 10, totalCount: 1230)
.SelectProperties(selectedProperties)
.IncludeCount()
.Build();
Console.WriteLine(response);
public class WeatherStation
{
public string? StationId { get; set; }
public string Location { get; set; }
public double? Temperature { get; set; }
}
Testing
This project uses [testing framework] for unit and integration tests. The test suite covers core functionality including OData parsing, SQL translation, and validation logic.
Running Tests
dotnet test
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- GeoAPI.Core (>= 1.7.5)
- NetTopologySuite (>= 2.6.0)
- NetTopologySuite.Features (>= 2.2.0)
- NetTopologySuite.IO.GeoJSON4STJ (>= 4.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Text.Json (>= 9.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of the Digitale Delta /ODataWriter library.