Инициализировать репозиторий «Дейл»

Первый коммит: модульный монолит ядра (.NET 10) и gRPC-сервисы
ai/ml/telegram, фронтенд Vue 3/Vite/Tailwind, документация (ТЗ,
инструкция пользователя, техдокументация, код-стайл), бэклог,
скрипты развёртывания и архив прототипа LeadRadar.
This commit is contained in:
Rustam Khalimov
2026-09-11 02:50:17 +03:00
commit 9e07568ddd
1402 changed files with 177470 additions and 0 deletions
@@ -0,0 +1,23 @@
using Deal.SharedKernel.Tenants;
namespace Deal.Infrastructure.Data;
/// <summary>
/// Контекст тенанта на AsyncLocal: пробрасывается через весь запрос.
/// </summary>
public sealed class TenantContext : ITenantContext
{
private static readonly AsyncLocal<TenantId?> Current = new();
public TenantId? TenantId => Current.Value;
public bool HasTenant => Current.Value is not null;
public string? SchemaName => Current.Value?.SchemaName;
/// <inheritdoc />
public void SetTenant(TenantId tenantId) => Current.Value = tenantId;
/// <inheritdoc />
public void Reset() => Current.Value = null;
}