You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
2.5 KiB
43 lines
2.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Threading.Tasks;
|
|
using Monitor.Models;
|
|
|
|
namespace Monitor.IRepositories.Base
|
|
{
|
|
public interface IBaseRepository<TEntity> where TEntity : class
|
|
{
|
|
Task<int> Execute(string sql, List<SqlParameter> parms, CommandType cmdType = CommandType.Text);
|
|
Task<List<TEntity>> Query(string sql, List<SqlParameter> parms, CommandType cmdType = CommandType.Text);
|
|
Task<int> Insert(TEntity model);
|
|
Task<int> InsertRange(List<TEntity> datas);
|
|
Task<int> Del(TEntity model);
|
|
Task<int> DelBy(Expression<Func<TEntity, bool>> delWhere);
|
|
Task<int> DeleteById(object id);
|
|
Task<int> BatchDeleteByIds(object[] ids);
|
|
Task<long> DeleteByLongId(object id);
|
|
Task<long> BatchDeleteByLongIds(object[] ids);
|
|
Task<int> ModifyAsync(TEntity model);
|
|
Task<int> Modify(TEntity model, params string[] propertyNames);
|
|
Task<int> ModifyBy(TEntity model, Expression<Func<TEntity, bool>> whereLambda, params string[] modifiedPropertyNames);
|
|
Task<List<TEntity>> GetList();
|
|
Task<List<TEntity>> GetListBy(Expression<Func<TEntity, bool>> whereLambda);
|
|
Task<TEntity> GetModelById(object value);
|
|
Task<TEntity> GetModelByAsync(Expression<Func<TEntity, bool>> whereLambda);
|
|
|
|
Task<int> Count(Expression<Func<TEntity, bool>> whereLambda);
|
|
int CountSync(Expression<Func<TEntity, bool>> whereLambda);
|
|
Task<List<TEntity>> GetListByAsync<TKey>(Expression<Func<TEntity, bool>> whereLambda, Expression<Func<TEntity, TKey>> orderLambda, bool isAsc = true);
|
|
Task<List<TEntity>> GetListBy<TKey>(int top, Expression<Func<TEntity, bool>> whereLambda, Expression<Func<TEntity, TKey>> orderLambda, bool isAsc = true);
|
|
Task<List<TEntity>> GetListBy<TKey1, TKey2>(Expression<Func<TEntity, bool>> whereLambda, Expression<Func<TEntity, TKey1>> orderLambda1, Expression<Func<TEntity, TKey2>> orderLambda2, bool isAsc1 = true, bool isAsc2 = true);
|
|
Task<List<TEntity>> GetListBy<TKey1, TKey2>(int top, Expression<Func<TEntity, bool>> whereLambda, Expression<Func<TEntity, TKey1>> orderLambda1, Expression<Func<TEntity, TKey2>> orderLambda2, bool isAsc1 = true, bool isAsc2 = true);
|
|
Task<List<TEntity>> GetPagedList<TKey>(int pageIndex, int pageSize, Expression<Func<TEntity, bool>> whereLambda, Expression<Func<TEntity, TKey>> orderByLambda, bool isAsc = true);
|
|
void RollBackChanges();
|
|
|
|
}
|
|
}
|