This commit is contained in:
mmrbnjd
2024-03-30 15:10:36 +03:30
parent f4588f3426
commit a9e3afdea4
60 changed files with 1752 additions and 70 deletions

View File

@@ -0,0 +1,39 @@
using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Back.Data.Contracts
{
public interface IAsyncRepository<T>
{
IQueryable<T> GetAll();
IQueryable<T> Get(Expression<Func<T, bool>> predicate);
IQueryable<T> Get(Expression<Func<T, bool>> predicate = null,
Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
string[] includeSrings = null,
bool disableTracking = true);
IQueryable<T> Get(Expression<Func<T, bool>> predicate = null,
Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null,
List<Expression<Func<T, object>>> includes = null,
bool disableTracking = true);
Task<bool> AddRangeAsync(ICollection<T> entites);
Task<T> AddAsync(T entity);
T? Add(T entity);
Task<bool> AddBoolResultAsync(T entity);
bool AddBoolResult(T entity);
Task<bool> UpdateAsync(T entity);
bool Update(T entity);
Task<bool> UpdateRangeAsync(ICollection<T> entites);
bool UpdateRange(ICollection<T> entites);
bool Delete(T entity);
Task<bool> DeleteRangeAsync(ICollection<T> entites);
Task<bool> DeleteAsync(T entity);
Task<List<SqlParameter>> RunSP(string query, List<SqlParameter> parameters);
Task ExecuteSql(string query);
}
}