23 lines
716 B
C#
23 lines
716 B
C#
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using xDataService.Db;
|
|
using xModels.Base;
|
|
|
|
namespace xDataService.Interfaces {
|
|
/// <summary>
|
|
/// Provide Unit Of Works Design Pattern for Db Transactions ...
|
|
/// Only Used on EFCore ...
|
|
/// </summary>
|
|
/// <typeparam name="TDbContext"></typeparam>
|
|
public interface IXUnitOfWorks<TDbContext> : IDisposable
|
|
where TDbContext : XDbContext {
|
|
TDbContext DbContext { get; }
|
|
DbSet<T> GetDbSet<T, TKey> () where T : XBaseEntity<TKey>;
|
|
int SaveChanges ();
|
|
Task<int> SaveChangesAsync (
|
|
CancellationToken cancellationToken = default
|
|
);
|
|
}
|
|
} |