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 where TEntity : class { Task Execute(string sql, List parms, CommandType cmdType = CommandType.Text); Task> Query(string sql, List parms, CommandType cmdType = CommandType.Text); Task Insert(TEntity model); Task InsertRange(List datas); Task Del(TEntity model); Task DelBy(Expression> delWhere); Task DeleteById(object id); Task BatchDeleteByIds(object[] ids); Task DeleteByLongId(object id); Task BatchDeleteByLongIds(object[] ids); Task ModifyAsync(TEntity model); Task Modify(TEntity model, params string[] propertyNames); Task ModifyBy(TEntity model, Expression> whereLambda, params string[] modifiedPropertyNames); Task> GetList(); Task> GetListBy(Expression> whereLambda); Task GetModelById(object value); Task GetModelByAsync(Expression> whereLambda); Task Count(Expression> whereLambda); int CountSync(Expression> whereLambda); Task> GetListByAsync(Expression> whereLambda, Expression> orderLambda, bool isAsc = true); Task> GetListBy(int top, Expression> whereLambda, Expression> orderLambda, bool isAsc = true); Task> GetListBy(Expression> whereLambda, Expression> orderLambda1, Expression> orderLambda2, bool isAsc1 = true, bool isAsc2 = true); Task> GetListBy(int top, Expression> whereLambda, Expression> orderLambda1, Expression> orderLambda2, bool isAsc1 = true, bool isAsc2 = true); Task> GetPagedList(int pageIndex, int pageSize, Expression> whereLambda, Expression> orderByLambda, bool isAsc = true); void RollBackChanges(); } }