DateOnlyTimeOnly.AspNet 1.0.2

Install-Package DateOnlyTimeOnly.AspNet -Version 1.0.2
dotnet add package DateOnlyTimeOnly.AspNet --version 1.0.2
<PackageReference Include="DateOnlyTimeOnly.AspNet" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DateOnlyTimeOnly.AspNet --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DateOnlyTimeOnly.AspNet, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DateOnlyTimeOnly.AspNet as a Cake Addin
#addin nuget:?package=DateOnlyTimeOnly.AspNet&version=1.0.2

// Install DateOnlyTimeOnly.AspNet as a Cake Tool
#tool nuget:?package=DateOnlyTimeOnly.AspNet&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DateOnlyTimeOnly.AspNet

Adds support for receiving and returning DateOnly/TimeOnly as ISO 8601 string to ASP.NET API

Installation

Get it from NuGet

  • Base package: NuGet
  • Swashbuckle support: NuGet

Usage

Call UseDateOnlyTimeOnlyStringConverters on options for AddControllers and AddJsonOptions:

builder.Services
    .AddControllers(options => options.UseDateOnlyTimeOnlyStringConverters())
    .AddJsonOptions(options => options.UseDateOnlyTimeOnlyStringConverters());

After that all DateOnly and TimeOnly action arguments will be received and returned as ISO 8601 string.

Swagger support

NSwag

No additional action is needed.

Swashbuckle

Install DateOnlyTimeOnly.AspNet.Swashbuckle package, and add UseDateOnlyTimeOnlyStringConverters to your swagger configuration:

builder.Services.AddSwaggerGen(c => c.UseDateOnlyTimeOnlyStringConverters());
  • net6.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DateOnlyTimeOnly.AspNet:

Package Downloads
DataFilters

Sets of classes to convert querystrings to strongly typed expressions.

DateOnlyTimeOnly.AspNet.Swashbuckle

Adds support for receiving and returning DateOnly/TimeOnly as ISO 8601 string to ASP.NET Core Web API 6

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 4,038 11/28/2021
1.0.1 1,639 9/16/2021
1.0.0 137 9/15/2021