Wts.Calendar.AspNetCore 1.0.0

dotnet add package Wts.Calendar.AspNetCore --version 1.0.0
                    
NuGet\Install-Package Wts.Calendar.AspNetCore -Version 1.0.0
                    
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="Wts.Calendar.AspNetCore" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wts.Calendar.AspNetCore" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Wts.Calendar.AspNetCore" />
                    
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 Wts.Calendar.AspNetCore --version 1.0.0
                    
#r "nuget: Wts.Calendar.AspNetCore, 1.0.0"
                    
#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 Wts.Calendar.AspNetCore@1.0.0
                    
#: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=Wts.Calendar.AspNetCore&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Wts.Calendar.AspNetCore&version=1.0.0
                    
Install as a Cake Tool

Wts.Calendar.AspNetCore

NuGet Downloads License

Official ASP.NET Core server integration for @wts-calendar/core. The package provides a typed event wire contract, Minimal API endpoints, validation, optimistic concurrency, and a replaceable storage boundary. It does not require a WTS-hosted backend and it does not control your authentication or database.

Install

dotnet add package Wts.Calendar.AspNetCore --version 1.0.0

The package targets net8.0 and net10.0 and has no third-party runtime dependencies. It uses the ASP.NET Core shared framework.

Component Supported
.NET 8 and 10
ASP.NET Core Minimal APIs and standard endpoint middleware
Browser clients Angular, React, Vue, Web Components
Native client React Native through the same JSON contract

Configure the server

using Wts.Calendar.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddWtsCalendarAspNetCore(options =>
{
    options.MaxPageSize = 500;
    options.RequireIfMatchForUpdate = true;
    options.RequireIfMatchForDelete = true;
});

builder.Services.AddSingleton<IWtsCalendarEventStore, SqlCalendarEventStore>();

var app = builder.Build();

var calendarApi = app.MapWtsCalendarEvents("/api/calendar/events");
calendarApi.RequireAuthorization("calendar-api");

app.Run();

SqlCalendarEventStore represents your implementation of IWtsCalendarEventStore. It can use EF Core, Dapper, MongoDB, a remote service, or the persistence layer your application already has.

For a local demo or a test, explicitly opt into process-local storage:

builder.Services.AddWtsCalendarInMemoryStore();

The in-memory store is thread-safe, but it is not durable and does not coordinate multiple server instances. Do not use it as production persistence.

Connect @wts-calendar/core

import {
  CalendarDataClient,
  createRestCalendarDataAdapter,
} from '@wts-calendar/core/data-adapter-sdk';

const endpoint = 'https://api.example.com/api/calendar/events';

const adapter = createRestCalendarDataAdapter({
  url: endpoint,
  mutationUrl: ({ type, id }) =>
    type === 'create' ? endpoint : `${endpoint}/${encodeURIComponent(id ?? '')}`,
  headers: async () => ({
    authorization: `Bearer ${await accessToken()}`,
  }),
});

const events = new CalendarDataClient(adapter);

The adapter sends visible ranges as offset-aware ISO 8601 values. All-day event fields use yyyy-MM-dd; timed events require Z or an explicit UTC offset. Mutation versions are sent through If-Match when supplied.

HTTP contract

Method Route Purpose
GET /api/calendar/events?start=...&end=...&timeZone=... Load a bounded visible range
GET /api/calendar/events/{id} Load one event and its ETag
POST /api/calendar/events Create an event; returns 201, Location, and ETag
PATCH or PUT /api/calendar/events/{id} Replace the current event representation
DELETE /api/calendar/events/{id} Delete an event

Validation failures use RFC 7807-compatible validation problems. Stale versions return 409 Conflict, which maps directly to the WTS data adapter's conflict mutation result. Set RequireIfMatchForUpdate and RequireIfMatchForDelete when every editing client retains entity tags.

Production responsibilities

The package deliberately leaves these application-level concerns to the host:

  • authentication and per-calendar/per-event authorization;
  • durable persistence, tenant isolation, and database migrations;
  • CORS origins, rate limits, request-body limits, and observability;
  • provider secrets and Google/Microsoft/CalDAV token storage;
  • conflict policy beyond the supplied entity-tag precondition.

Apply authorization to the returned RouteGroupBuilder. Configure CORS with an explicit origin list; do not combine credentialed requests with wildcard origins. For chunked requests, also configure the server's normal maximum request body size—the package's MaxPayloadBytes check applies when Content-Length is known.

Build and verify this repository

dotnet build Wts.Calendar.AspNetCore.sln --configuration Release
dotnet run --project tests/Wts.Calendar.AspNetCore.Conformance \
  --configuration Release
dotnet pack src/Wts.Calendar.AspNetCore --configuration Release \
  --output artifacts

The conformance executable starts a real loopback ASP.NET Core server and checks create, range loading, strict preconditions, conflict mapping, update, validation, delete, ETags, and all-day serialization without adding a test-framework runtime dependency.

License

MIT © Suman Mandal.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  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 is compatible.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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.0 99 9/2/2026

Initial ASP.NET Core integration with range queries, CRUD endpoints, optimistic concurrency, validation, and a replaceable event store.