I read that Domain project shouldn't specify any ORM. So if I have to create interface for DbContext implemented in Infrastructture project, how can I do it? How can I specify all required DbSet? Interface in Domain project:
public interface IConfigurationDbContext
{
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
}
Implementation in Infrastructure project:
public class ConfigurationDbContext : DbContext, IConfigurationDbContext
{
public ConfigurationDbContext([NotNull] DbContextOptions<ConfigurationDbContext> options) : base(options)
{
}
public DbSet<Client> Clients { get; set; }
public DbSet<ApiResource> ApiResources { get; set; }
public DbSet<ApiScope> ApiScopes { get; set; }
public DbSet<IdentityResource> IdentityResources { get; set; }
}
As u see, IConfigurationDbContext interface doesn't contain any DbSet, because this way require to specify used ORM in Domain project. So how should I create this interface?