A collection of .NET building blocks for backend services: application hosting, YAML configuration, data access, e-mail and SMS, notifications, request processing, file formats, localization and more.
Renamed: formerly
Curiosity.*by SIIS Ltd. Since 2.0.0 the packages are published asCuriosus.*by curiosus-dev. To migrate, replaceCuriositywithCuriosusin package references and code.
- Small, focused packages. Every area is an abstraction package plus implementations (
Curiosus.EMail+ SMTP/Mailgun/Unisender Go,Curiosus.SMS+ smsc.ru/iqsms.ru,Curiosus.SFTP+ SSH.NET), so an application depends on the contract and picks the provider in one registration. - Production defaults. Options are validated at startup, so a wrong configuration fails fast instead of at the first request; errors come back as typed codes rather than provider-specific exceptions.
- Consistent across services. The same bootstrapping, configuration layout, logging and error model in console tools, background workers and web applications.
- Plain DI. Everything is registered with
Add...extensions onIServiceCollection, no framework to adopt.
- Hosting — bootstrappers for console tools, background services and ASP.NET Core apps: CLI arguments, YAML config with validation, NLog, async app initializers, thread pool tuning, watchdog services.
- Configuration — layered
config*.ymlfiles (secret, per-environment) with environment variable and CLI overrides, strongly typed options validation and startup printing. - Data access — abstractions over EF Core and Dapper with transaction-completed events, pagination, a Polly retry policy for concurrency errors and PostgreSQL helpers (binary COPY bulk insert).
- E-mail and SMS — one
IEMailSender/ISmsSendercontract with SMTP (MailKit), Mailgun, Unisender Go, smsc.ru and iqsms.ru providers, unified error codes and per-message overrides. - Notifications — one
INotificatorcall fans an event out to e-mail, SMS or custom channels running as queued background services, with post-processors for the results. - Request processing — a fixed pool of workers in a hosted service, fed from a Postgres table queue
(
LISTEN/NOTIFY) or RabbitMQ; plus a RabbitMQ request-reply client. - Files — streaming XLSX (NPOI) and CSV (Sylvan/CsvHelper) readers and writers, ZIP archives (SharpZipLib), SFTP (SSH.NET).
- Web — ASP.NET Core middleware, model binders, data protection, reCAPTCHA, sitemap; localization keyed by source text with plural forms for code and Razor views.
- Toolkit — distributed unique ids, the
Response/Errorresult model, date/time helpers, memory cache helpers, data annotations, a database-synchronized clock, sensitive data masking, performance tracing.
Install the packages you need, for example a background service with YAML configuration:
dotnet add package Curiosus.Hostingpublic class AppConfiguration : CuriosusAppConfiguration
{
public AppConfiguration()
{
AppName = "Sample Worker";
}
}
public class AppBootstrapper : CuriosusServiceAppBootstrapper<CuriosusCLIArguments, AppConfiguration>
{
public AppBootstrapper()
{
ConfigureServices((context, services, configuration) =>
{
services.AddHostedService<SampleWorker>();
});
}
}
// Program.cs
return await new AppBootstrapper().RunAsync(args);Each package README shows its registration and configuration, see Available packages.
Packages depend only on what they need. Curiosus.Tools is the foundation with few dependencies; abstraction
packages (Curiosus.DAL, Curiosus.EMail, Curiosus.SMS, Curiosus.SFTP, Curiosus.Notifications,
Curiosus.RequestProcessing, Curiosus.FileDataReaderWriters, Curiosus.Archiver) define contracts, and
implementation packages add one provider each. Libraries and domain code reference abstractions; the application
references the implementations it registers.
Each package is versioned and released independently, see its CHANGELOG.md.
Full documentation: curiosus-dev.github.io/Curiosus.Utils.
Coverage is line coverage by the repository tests, "no tests" means the package has none yet.
Licensed under the MIT License.