namespace SwBLL.Provisioning; /// /// Reference/standard-data DdlScripts are authored once and applied to many client databases, /// each of which is tenant-scoped (confirmed live: MCURRENCY/MUOM/etc. carry a TENANTID column /// equal to the owning client's own ClientId, not a shared/global value — tracker §35 Pillar 3). /// A script's SQL text can't hardcode that value at authoring time, so it carries the literal /// token below instead; both real script-execution paths (ProvisioningBLL.ProvisionClientDatabase /// for initial baseline application, ChangeRequestBLL.ExecuteDdlCr for ongoing updates) substitute /// it immediately before handing the script to ITargetDbExecutor.ExecuteScriptAsync. /// public static class DdlScriptTemplating { public const string TenantIdToken = "{{TENANTID}}"; public static string SubstituteTenantId(string sql, int tenantId) => sql.Replace(TenantIdToken, tenantId.ToString()); }