JoinRpg.Common.PrimitiveTypes 2026.9.533

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

JoinRpg.Common.PrimitiveTypes

Общие типы для сайтов вокруг joinrpg.ru: идентификатор пользователя, email, имя, контакты, ссылки на соцсети, диапазон дат. Нужен, если сайт логинит пользователей через id.joinrpg.ru или обменивается данными с joinrpg.ru.

dotnet add package JoinRpg.Common.PrimitiveTypes

Нужен net10.0. Всё лежит в JoinRpg.Common.PrimitiveTypes, кроме UserInfoHeader — он в JoinRpg.Common.PrimitiveTypes.Users.

Пользователь

var userId = UserIdentification.Parse("UserId(42)", null);  // «42» тоже разберётся
int raw = userId;                                           // неявно
UserIdentification? maybe = UserIdentification.FromOptional(nullableInt);  // null → null
  • UserIdentification — id пользователя joinrpg.ru.
  • UserInfoHeader — id, отображаемое имя (UserDisplayName) и аватарка: то, что нужно, чтобы показать пользователя в списке.
  • UserFullName из PrefferedName, BornName, SurName, FatherName.
  • UserContacts: Email, VkSocialLink, TelegramSocialLink, LiveJournalId.
  • AvatarIdentification, AvatarInfo — аватарка по id и готовый URL с размером.

Типизированные строки

Email, PhoneNumber, PrefferedName, MarkdownString, VkId и другие с атрибутом [TypedStringValue] проверяют значение при создании из строки — неявным приведением, FromOptional или Parse: обрезают пробелы и проверяют длину (Email.MinLength, Email.MaxLength), у Email — ещё наличие @. Неверная строка даёт ArgumentException. new Email(...) значение не проверяет.

Email email = "user@example.com";                    // неявно из string, с проверкой
Email? optional = Email.FromOptional(input);         // пустая строка или пробелы → null
string s = email;                                    // неявно в string

ToString() даёт Email(user@example.com); для вывода — .Value или приведение к string. MarkdownString не обрезается и не ограничен по длине.

Прочее

  • DateRange — диапазон дат игры; DateRangeFormatter.FormatDisplay(range, culture) выводит его («1–5 марта 2026» для ru-RU; без culture берётся текущая).
  • CountHelper.DisplayCount(5, "заявка", "заявки", "заявок") — число со склонением.
  • TelegramChatId — chat_id Bot API (бывает отрицательным); TelegramHtmlString — текст сообщения с HTML-разметкой Telegram; KogdaIgraIdentification — id игры на kogda-igra.ru.
  • SendingResult — исход отправки уведомления: успех, повторяемая ошибка, общая ошибка сервиса (нужна пауза), постоянная ошибка адресата.
  • IUriLocator<T> — интерфейс «дай ссылку на объект».

Сериализация, конфигурация, EF Core

Типизированные Id сериализуются в JSON строкой вида "UserId(42)" (TypedEntityIdJsonConverter<T>) и читаются из конфигурации (TypedEntityIdTypeConverter<T>) — атрибуты уже стоят на типах. Типизированные строки своего конвертера не имеют: в JSON это объект {"Value": "..."}, при чтении значение не проверяется. Для колонок EF Core — пакет JoinRpg.Common.EntityFrameworkCore.

Свои типы

Атрибуты [TypedEntityId] и [TypedStringValue] лежат здесь, но код по ним генерирует JoinRpg.Common.PrimitiveTypes.SourceGenerator. Этот пакет его не запускает — если нужны свои типы, подключите генератор отдельно, см. его README.

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 (3)

Showing the top 3 NuGet packages that depend on JoinRpg.Common.PrimitiveTypes:

Package Downloads
JoinRpg.Common.WebInfrastructure

ASP.NET Core web infrastructure: Serilog logging, OpenTelemetry, EF Core PostgreSQL, health checks, data protection, background tasks, OIDC login against id.joinrpg.ru.

JoinRpg.Common.WebComponents

Reusable Blazor components of Joinrpg.ru: buttons, dialogs, inputs, icons.

JoinRpg.Common.EntityFrameworkCore

EF Core mapping helpers for JoinRpg.Common.PrimitiveTypes typed entity ids.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.9.533 87 10/29/2026
2026.9.438 208 10/27/2026
2026.9.363 122 10/22/2026
2026.9.217 159 10/16/2026
2026.8.421 258 10/4/2026
2026.8.383 124 10/4/2026
2026.8.256 184 9/29/2026
2026.8.12 354 9/6/2026
2026.8.0 178 9/2/2026
2026.7.34 152 8/26/2026
2026.7.32 144 8/26/2026
2026.7.14 136 8/24/2026
2026.7.10 172 8/23/2026
2026.5.26 145 8/4/2026
2026.3.87 141 5/12/2026
2026.3.77 145 5/11/2026
2026.3.76 130 5/11/2026
2026.3.72 141 5/8/2026