50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Prefab.Data.Entities;
|
|
|
|
namespace Prefab.Data;
|
|
|
|
/// <summary>
|
|
/// Abstraction over the Prefab relational database context.
|
|
/// </summary>
|
|
public interface IPrefabDb : IDisposable, IAsyncDisposable
|
|
{
|
|
/// <summary>
|
|
/// Gets the EF Core database facade for executing commands and migrations.
|
|
/// </summary>
|
|
DatabaseFacade Database { get; }
|
|
|
|
/// <summary>
|
|
/// Persists pending changes to the database.
|
|
/// </summary>
|
|
int SaveChanges();
|
|
|
|
/// <summary>
|
|
/// Persists pending changes to the database asynchronously.
|
|
/// </summary>
|
|
/// <param name="cancellationToken">Token used to cancel the operation.</param>
|
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Gets the audit log set.
|
|
/// </summary>
|
|
DbSet<AuditLog> AuditLogs { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the audit log item set.
|
|
/// </summary>
|
|
DbSet<AuditLogItem> AuditLogItems { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the generic attribute set.
|
|
/// </summary>
|
|
DbSet<GenericAttribute> GenericAttributes { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the seeder audit set.
|
|
/// </summary>
|
|
DbSet<SeederLog> SeederLogs { get; }
|
|
}
|
|
|
|
|