using Microsoft.EntityFrameworkCore; namespace {{ProjectName}}.Application.Common.Interfaces; /// /// Interface for Extensions DbContext (client-specific entities). /// /// For Core entities in the V1 whitelist (User, Role, Tenant, TenantOrganisation, /// Department, JobTitle, Office, Language, Group), declare real navigation /// properties on your entities — the base class SmartStackExtensionDbContext /// exposes them via ExcludeFromMigrations, so EF emits a real /// cross-schema FK at migration time. /// /// For Core entities OUTSIDE the whitelist (sessions, tokens, navigation, /// permissions, AI / workflow / support internals, audit logs, …) inject /// ICoreDataService and use its lookup helpers. /// public interface IExtensionsDbContext { // === YOUR ENTITIES === // Add DbSet properties for your entities here. Example: // DbSet Orders { get; } /// /// Generic entity-set accessor. Lets services and handlers query any mapped /// extension entity (_context.Set<Order>()) without declaring a /// typed DbSet property for each one — and lets unit tests inject an /// in-memory ExtensionsDbContext through this interface. /// DbSet Set() where TEntity : class; /// /// Saves all changes made in this context to the database. /// Task SaveChangesAsync(CancellationToken cancellationToken = default); }