2025-07-19 09:25:01 +08:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2025-07-19 11:11:01 +08:00
|
|
|
namespace DMS.Infrastructure.Interfaces
|
2025-07-19 09:25:01 +08:00
|
|
|
{
|
|
|
|
|
public interface IDbContext
|
|
|
|
|
{
|
|
|
|
|
// Define common database operations here, e.g.,
|
|
|
|
|
// Task<TEntity> GetByIdAsync<TEntity>(int id) where TEntity : class;
|
|
|
|
|
// Task AddAsync<TEntity>(TEntity entity) where TEntity : class;
|
|
|
|
|
// Task UpdateAsync<TEntity>(TEntity entity) where TEntity : class;
|
|
|
|
|
// Task DeleteAsync<TEntity>(TEntity entity) where TEntity : class;
|
2025-07-19 11:11:01 +08:00
|
|
|
// ITransaction GetClient(); // This should NOT be here if you want to hide SqlSugar
|
2025-07-19 09:25:01 +08:00
|
|
|
|
|
|
|
|
// For now, we'll just keep it empty or add methods as needed.
|
2025-07-19 11:11:01 +08:00
|
|
|
// The primary goal is to abstract away ITransaction.
|
|
|
|
|
// The ITransaction already handles transactions.
|
2025-07-19 09:25:01 +08:00
|
|
|
}
|
|
|
|
|
}
|