Reo.Core.SequenceGenerator
8.0.825
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Reo.Core.SequenceGenerator --version 8.0.825
NuGet\Install-Package Reo.Core.SequenceGenerator -Version 8.0.825
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="Reo.Core.SequenceGenerator" Version="8.0.825" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reo.Core.SequenceGenerator" Version="8.0.825" />
<PackageReference Include="Reo.Core.SequenceGenerator" />
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 Reo.Core.SequenceGenerator --version 8.0.825
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Reo.Core.SequenceGenerator, 8.0.825"
#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 Reo.Core.SequenceGenerator@8.0.825
#: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=Reo.Core.SequenceGenerator&version=8.0.825
#tool nuget:?package=Reo.Core.SequenceGenerator&version=8.0.825
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Reo.Core.SequenceGenerator
Описание пакета
Reo.Core.SequenceGenerator — это библиотека, которая обеспечивает генерацию и управление последовательностями данных в .NET-приложениях. Пакет решает проблему автоматического создания и проверки существования необходимых последовательностей (например, для генерации уникальных идентификаторов, счетчиков или других сценариев, требующих упорядоченных данных).
Основные функции:
- Создание последовательностей при их отсутствии.
- Проверка наличия последовательностей в фоновом режиме.
- Интеграция с конфигурацией через
appsettings.json.
Основные компоненты
1. ISequenceGeneratorClient
- Интерфейс для взаимодействия с внешним API генератора последовательностей.
- Методы:
CreateAsync,GetAllAsync,UpdateAsyncи др.
2. Sequence
- Класс, представляющий одну последовательность.
- Свойства:
Tenant,Name,Value,Timestamp.
3. SequenceNameCheckService
- Фоновый сервис, проверяющий наличие необходимых последовательностей и создающий их при отсутствии.
- Работает асинхронно, используя
ISequenceGeneratorClient.
4. SequenceGeneratorOptions
- Класс для хранения конфигурационных параметров:
Host: URL сервиса генерации последовательностей.AdminUser,AdminPassword: учетные данные администратора.Tenant: идентификатор тенанта.Names: список имен последовательностей, которые должны существовать.
Требования
- .NET версии: .NET 8.0 и выше.
- Зависимости:
Microsoft.Extensions.Hosting(для фоновых сервисов).Microsoft.Extensions.Logging(для логирования).Microsoft.Extensions.Options(для конфигурации).Reo.Core.Extensions.EnumerableExtensions(для расширений LINQ).
Установка
NuGet Package Manager:
Install-Package Reo.Core.SequenceGenerator
.NET CLI:
dotnet add package Reo.Core.SequenceGenerator
Настройка
Регистрация в DI-контейнере (ASP.NET Core)
// Startup.cs или Program.cs
services.AddOptions<SequenceGeneratorOptions>()
.Bind(Configuration.GetSection("SequenceGenerator"));
services.AddSingleton<ISequenceGeneratorClient, SequenceGeneratorClient>();
services.AddHostedService<SequenceNameCheckService>();
Конфигурационный файл appsettings.json:
{
"SequenceGenerator": {
"Host": "https://api.sequence.example.com",
"AdminUser": "admin",
"AdminPassword": "securepassword",
"Tenant": "my-tenant",
"Names": ["order-id", "user-code"]
}
}
Использование
Пример 1: Создание последовательности
var client = new SequenceGeneratorClient("https://api.sequence.example.com", "admin", "securepassword", "my-tenant");
var sequence = await client.CreateAsync("order-id");
Console.WriteLine($"Создана последовательность: {sequence.Name} (Value: {sequence.Value})");
Пример 2: Проверка и создание всех необходимых последовательностей
var options = new SequenceGeneratorOptions
{
Host = "https://api.sequence.example.com",
AdminUser = "admin",
AdminPassword = "securepassword",
Tenant = "my-tenant",
Names = new List<string> { "order-id", "user-code" }
};
var service = new SequenceNameCheckService(new SequenceGeneratorClient(options), logger, options);
await service.ExecuteAsync(CancellationToken.None);
Пример 3: Получение всех последовательностей
var sequences = await client.GetAllAsync();
foreach (var seq in sequences)
{
Console.WriteLine($"Последовательность: {seq.Name} (Value: {seq.Value}, Timestamp: {seq.Timestamp})");
}
Лицензия
Данный пакет распространяется под лицензией MIT.
| Product | Versions 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 was computed. 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.
-
net8.0
- FluentValidation (>= 11.11.0)
- FluentValidation.AspNetCore (>= 11.3.1)
- Flurl (>= 4.0.0)
- Flurl.Http (>= 4.0.2)
- Flurl.Http.Newtonsoft (>= 0.9.1)
- IdentityModel (>= 7.0.0)
- JetBrains.Annotations (>= 2025.2.4)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.23)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 8.0.23)
- Microsoft.Extensions.Configuration (>= 10.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection (>= 10.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Http.Polly (>= 10.0.2)
- Microsoft.Extensions.Logging (>= 10.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.2)
- Newtonsoft.Json (>= 13.0.4)
- Polly (>= 8.5.0)
- Reo.Core.Auth (>= 8.0.825)
- stbychkov.AutoLoggerMessage (>= 1.0.15)
- Swashbuckle.AspNetCore (>= 10.1.0)
- System.IO.Pipelines (>= 10.0.2)
- System.Linq.Async (>= 7.0.0)
- System.Text.Encodings.Web (>= 10.0.2)
- System.Text.Json (>= 10.0.2)
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 |
|---|---|---|
| 10.0.15 | 93 | 2/6/2026 |
| 10.0.14 | 97 | 2/6/2026 |
| 10.0.13 | 91 | 2/4/2026 |
| 10.0.12 | 89 | 2/3/2026 |
| 10.0.11 | 98 | 2/2/2026 |
| 10.0.10 | 95 | 1/29/2026 |
| 10.0.9 | 94 | 1/29/2026 |
| 10.0.8 | 109 | 1/27/2026 |
| 10.0.6 | 102 | 1/26/2026 |
| 10.0.5 | 99 | 1/23/2026 |
| 10.0.3 | 103 | 1/23/2026 |
| 10.0.2 | 100 | 1/23/2026 |
| 10.0.1 | 93 | 1/22/2026 |
| 8.0.829 | 118 | 1/22/2026 |
| 8.0.828 | 105 | 1/22/2026 |
| 8.0.827 | 107 | 1/22/2026 |
| 8.0.826 | 106 | 1/22/2026 |
| 8.0.825 | 100 | 1/22/2026 |
| 8.0.824 | 90 | 1/21/2026 |
| 8.0.823 | 94 | 1/21/2026 |
Loading failed