Nueva mejoras Y estabilidad
This commit is contained in:
20
MicroORM/Interfaces/IRepository.cs
Normal file
20
MicroORM/Interfaces/IRepository.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Data;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace MicroORM.Interfaces;
|
||||
|
||||
public interface IRepository<T>
|
||||
{
|
||||
Task<int> InsertAsync<T>(T entity, IDbConnection? connection = null, IDbTransaction? transaction = null);
|
||||
Task<bool> UpdateAsync<T>(T entity, IDbConnection? connection = null, IDbTransaction? transaction = null);
|
||||
Task<T?> GetByIdAsync(object id);
|
||||
|
||||
Task<IEnumerable<T>> GetAllAsync(Expression<Func<T, bool>>? filter = null,
|
||||
Expression<Func<T, object>>? orderBy = null, bool descending = false);
|
||||
Task<bool> DeleteAsync(object id);
|
||||
Task<int> SaveAsync<T>(T entity);
|
||||
Task<IReadOnlyList<int>> SaveAsyncList<T>(IEnumerable<T> entities);
|
||||
Task<T?> QuerySingleAsync<T>(string sql, object? parameters = null);
|
||||
Task<IEnumerable<T>> QueryAsync<T>(string sql, object? parameters = null);
|
||||
Task<T?> ExecuteScalarAsync<T>(string sql, object? parameters = null);
|
||||
}
|
||||
Reference in New Issue
Block a user