JoinRpg.Common.WebInfrastructure.Interfaces 2026.9.668

There is a newer version of this package available.
See the version list below for details.
dotnet add package JoinRpg.Common.WebInfrastructure.Interfaces --version 2026.9.668
                    
NuGet\Install-Package JoinRpg.Common.WebInfrastructure.Interfaces -Version 2026.9.668
                    
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="JoinRpg.Common.WebInfrastructure.Interfaces" Version="2026.9.668" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JoinRpg.Common.WebInfrastructure.Interfaces" Version="2026.9.668" />
                    
Directory.Packages.props
<PackageReference Include="JoinRpg.Common.WebInfrastructure.Interfaces" />
                    
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 JoinRpg.Common.WebInfrastructure.Interfaces --version 2026.9.668
                    
#r "nuget: JoinRpg.Common.WebInfrastructure.Interfaces, 2026.9.668"
                    
#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 JoinRpg.Common.WebInfrastructure.Interfaces@2026.9.668
                    
#: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=JoinRpg.Common.WebInfrastructure.Interfaces&version=2026.9.668
                    
Install as a Cake Addin
#tool nuget:?package=JoinRpg.Common.WebInfrastructure.Interfaces&version=2026.9.668
                    
Install as a Cake Tool

JoinRpg.Common.WebInfrastructure.Interfaces

Контракты фоновых джоб Joinrpg — лёгкая зависимость для проектов, которые объявляют джобы, но не должны тянуть весь пакет JoinRpg.Common.WebInfrastructure (Serilog, OpenTelemetry, EF Core).

dotnet add package JoinRpg.Common.WebInfrastructure.Interfaces

Нужен net10.0, всё лежит в JoinRpg.Common.WebInfrastructure.Job.

Джоба и регистрация

using JoinRpg.Common.WebInfrastructure.Job;

[JobDelay(9)] // опционально: сдвиг планового запуска от полуночи UTC, в часах
class AdvertisementJob : IJob
{
    public Task RunOnce(CancellationToken cancellationToken) { /* ... */ }
}

services.AddJob<AdvertisementJob>();

AddJob регистрирует сам класс, раннер (создаётся фабрикой IJobRunnerFactory, реализация — в WebInfrastructure) и маркер RegisteredJob. Планировщик (полночь UTC, at-most-once в сутки, журнал через IJobRepository) — AddMidnightJobs из пакета JoinRpg.Common.WebInfrastructure: он сам находит все зарегистрированные джобы по маркерам при старте, порядок вызовов AddJob не важен.

Джоба обязана быть идемпотентной: если она вчера не отработала, сегодня должна доделать за вчера. Выключение конфигом — секция DailyJobs:Disabled (короткое или полное имя класса), см. JobsOptions.

HTML-санитайзеры (HtmlSanitize)

Контракты одноразовых HTML-санитайзеров: IJoinHtmlSanitizer (Sanitize + IDisposable) и три профиля — IJoinSimpleHtmlSanitizer (пропускает безопасное форматирование), IJoinRemoveAllHtmlSanitizer (выкидывает всю разметку), IJoinTelegramHtmlSanitizer (только inline-разметка для Telegram). Реализация поверх пула (Microsoft.Extensions.ObjectPool) и регистрация AddJoinHtmlSanitizers() — в пакете JoinRpg.Common.WebInfrastructure; Dispose возвращает экземпляр в пул.

Временно для статических вызовов есть JoinHtmlSanitizerLocator (Obsolete — уберём, когда рендеринг markdown переведут на DI).

Типы

  • IJob + JobDelayAttribute — контракт джобы.
  • AddJob<TJob>() — регистрация.
  • IJobRunner — запуск джобы в переданном scope под имперсонацией (для админской страницы и тестов); реализация раннера — в JoinRpg.Common.WebInfrastructure.
  • IJobRunnerFactory — фабрика раннеров; реализацию регистрирует AddMidnightJobs.
  • IJobImpersonator — под кем выполняются джобы; реализует хост-приложение (в Joinrpg Portal — робот-администратор).
  • IJobRepository + JobId — журнал «один запуск в сутки» (уникальный индекс JobName + DayOfRun).
  • JobsOptions + RegisteredJob — настройка DailyJobs:Disabled и маркер зарегистрированной джобы.

Как это устроено целиком — ADR002.

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JoinRpg.Common.WebInfrastructure.Interfaces:

Package Downloads
JoinRpg.Common.WebInfrastructure

ASP.NET Core web infrastructure: Serilog logging, OpenTelemetry, EF Core data protection in PostgreSQL, health checks, midnight job scheduler (contracts in JoinRpg.Common.WebInfrastructure.Interfaces), OIDC login against id.joinrpg.ru.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.9.680 307 11/8/2026
2026.9.668 163 11/8/2026
2026.9.651 216 11/7/2026