Kanject.Core.Annotations.Attributes
3.12.7
Prefix Reserved
See the version list below for details.
dotnet add package Kanject.Core.Annotations.Attributes --version 3.12.7
NuGet\Install-Package Kanject.Core.Annotations.Attributes -Version 3.12.7
<PackageReference Include="Kanject.Core.Annotations.Attributes" Version="3.12.7" />
<PackageVersion Include="Kanject.Core.Annotations.Attributes" Version="3.12.7" />
<PackageReference Include="Kanject.Core.Annotations.Attributes" />
paket add Kanject.Core.Annotations.Attributes --version 3.12.7
#r "nuget: Kanject.Core.Annotations.Attributes, 3.12.7"
#:package Kanject.Core.Annotations.Attributes@3.12.7
#addin nuget:?package=Kanject.Core.Annotations.Attributes&version=3.12.7
#tool nuget:?package=Kanject.Core.Annotations.Attributes&version=3.12.7
Kanject.Core.Annotations.Attributes
The attribute and enum types that Kanject source generators read: [Parallel], [Recurring], [RecurringHosted], [QueryableEnum], [EnumParameter], [MultiTenant] and their option enums. The package contains only these declarations. It has no runtime logic and no package dependencies.
The attributes do nothing by themselves. Code is generated only in a project where the matching generator runs; for everything except [MultiTenant], that generator is Kanject.Core.Annotations.
Installation
You rarely need to reference this package directly. It is a dependency of Kanject.Core.Annotations, the generator package that you add alongside Kanject.Core to use these attributes:
<ItemGroup>
<PackageReference Include="Kanject.Core" />
<PackageReference Include="Kanject.Core.Annotations" PrivateAssets="all" />
</ItemGroup>
Reference the attributes directly only when a project needs the types without the generators, for example a shared contracts assembly that declares annotated types but does not take a dependency on Kanject.Core:
dotnet add package Kanject.Core.Annotations.Attributes
Targets .NET Standard 2.0, .NET 8, .NET 9 and .NET 10.
Quick start
using System.ComponentModel;
using Kanject.Core.Annotations.Attributes.Parallel;
using Kanject.Core.Annotations.Attributes.QueryableEnums;
using Kanject.Core.Annotations.Attributes.Recurring;
using Kanject.Core.Annotations.Attributes.Recurring.Enums;
namespace Shop;
[QueryableEnum(ConstantParameters = ["Wire"])]
public enum OrderStatus
{
[EnumParameter("Wire", "pending"), Description("Awaiting payment.")] Pending,
[EnumParameter("Wire", "shipped"), Description("Handed to the carrier.")] Shipped,
}
public sealed partial class OrderJobs
{
[Parallel(MaxDegreeOfParallelism = 8, RetryCount = 2, RetryBackoffMs = 250)]
public ValueTask ShipAsync(Order order, CancellationToken ct) => ValueTask.CompletedTask;
[Recurring(1, RecurringRateUnit.Minutes, MaxJitterMs = 2_000)]
[RecurringHosted(Name = "OrderSweep", Lifetime = RecurringServiceLifetime.Scoped)]
public Task SweepAsync(CancellationToken ct) => Task.CompletedTask;
}
With Kanject.Core and Kanject.Core.Annotations referenced, this produces OrderStatusQuery (including OrderStatusQuery.Wires.Pending), ShipParallelAsync(...), SweepAsyncRecurringAsync(...), and a hosted service registered through AddOrderJobsSweepAsyncRecurring(...). The Kanject.Core and Kanject.Core.Annotations packages describe the generated APIs.
Public surface
Kanject.Core.Annotations.Attributes.Parallel
| Type | Purpose |
|---|---|
ParallelAttribute |
Marks a method for generated parallel fan-out overloads. Options: MaxDegreeOfParallelism (0 means processor count), ChunkingMode, ChunkSize, ChunkTimeoutMs, StopOnException (default true), FailOnTimeout (default true), RetryCount, RetryBackoffMs |
ParallelHostedAttribute |
Hosting options for a [Parallel] method: Name, Lifetime, BatchSize, BatchFlushIntervalMs, RestartOnFault. The analyzer checks it, but the current generator emits no hosting code for it (KANPAR014 warns) |
Enums.ParallelChunkingMode |
EvenSplit (default) or FixedChunkSize |
Kanject.Core.Annotations.Attributes.Recurring
| Type | Purpose |
|---|---|
RecurringAttribute |
[Recurring(rateValue, rateUnit)] marks a method for a generated schedule loop. Options: MaxIterations, MaxDurationSeconds, StopOnException (default true), MaxJitterMs |
RecurringHostedAttribute |
Adds a generated BackgroundService and a DI registration method to a [Recurring] method. Options: Name, Lifetime (default Singleton), StartImmediately (default true), RestartOnFault (default false), LeaseKey, LeaseDurationSeconds (default 60), CheckpointKey |
Enums.RecurringRateUnit |
Seconds, Minutes, Hours, Days |
Enums.RecurringServiceLifetime |
Singleton (resolve the owner once) or Scoped (a new DI scope per run) |
Kanject.Core.Annotations.Attributes.QueryableEnums
| Type | Purpose |
|---|---|
QueryableEnumAttribute |
Marks an enum for generated lookup and parsing helpers. The optional constructor argument renames the generated {Name}Query class; ConstantParameters lists the [EnumParameter] names to emit as const string classes |
EnumParameterAttribute |
[EnumParameter(name, params value)] attaches named string metadata to an enum member. Can be applied more than once per member |
Kanject.Core.Annotations.Attributes.Tenancy
| Type | Purpose |
|---|---|
MultiTenantAttribute |
Marks a repository or DbContext as multi-tenant; Strategy defaults to Siloed. It is read by the DynamoDB provider's generator (Kanject.Core.NoSqlDatabase.Provider.DynamoDb.Annotations), not by Kanject.Core.Annotations |
Enums.TenancyStrategy |
Siloed (a table per tenant, {tenantId}.{TableName}) or Pooled (a shared table with keys prefixed {tenantId}#) |
Related packages
| Package | Role | Availability |
|---|---|---|
Kanject.Core |
Runtime library the generated code calls into | nuget.org |
Kanject.Core.Annotations |
Source generators and analyzers that read the Parallel, Recurring and QueryableEnum attributes; depends on this package | nuget.org |
Kanject.Core.NoSqlDatabase.Provider.DynamoDb.Annotations |
DynamoDB repository generator; reads [MultiTenant] |
Commercial license (not on nuget.org) |
License
Licensed under the Kanject Code Libraries License Agreement (KCLLA); the full text ships in this package as LICENSE.md. Organizations whose trailing-twelve-month gross revenue and total funding raised are each below US$250,000 may use it at no cost under the Free Tier. At or above either threshold a commercial license is required — contact commercial@kanjectbusiness.com.
| 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 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 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 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. |
| .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
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Kanject.Core.Annotations.Attributes:
| Package | Downloads |
|---|---|
|
Kanject.Core.Annotations
Kanject Core Annotations |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.14.0 | 66 | 10/2/2026 |
| 3.13.1 | 562 | 9/27/2026 |
| 3.13.0 | 531 | 9/27/2026 |
| 3.12.7 | 522 | 9/26/2026 |
| 3.12.6 | 599 | 9/7/2026 |
| 3.12.5 | 526 | 8/27/2026 |
| 3.12.4 | 656 | 8/22/2026 |
| 3.12.3 | 567 | 8/10/2026 |
| 3.12.2 | 550 | 8/9/2026 |
| 3.12.1 | 579 | 8/5/2026 |
| 3.12.0 | 602 | 8/5/2026 |
| 3.11.0 | 634 | 8/3/2026 |
| 3.10.6 | 632 | 7/30/2026 |
| 3.10.5 | 686 | 7/18/2026 |
| 3.10.4 | 183 | 7/13/2026 |
| 3.10.3 | 409 | 7/11/2026 |
| 3.10.2 | 500 | 7/11/2026 |
| 3.10.0 | 2,331 | 7/9/2026 |