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" />
                    
Directory.Packages.props
<PackageReference Include="DigitaleDelta.ODataWriter" />
                    
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 DigitaleDelta.ODataWriter --version 1.0.2
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=DigitaleDelta.ODataWriter&version=1.0.2
                    
Install as a Cake Tool

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 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.

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.0.2 89 9/12/2025
1.0.1 127 9/9/2025
1.0.0 143 9/8/2025

Initial release of the Digitale Delta /ODataWriter library.