using Competition.IBLL; using Competition.IDAL; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace Competition.BLL { public class BaseService : IBaseService where T : class { private readonly IBaseRepository _repository; public BaseService(IBaseRepository repository) { _repository = repository; } public T Find(TKey id) { return _repository.Find(id); } public T Find(Expression> wherelamb) { return _repository.Find(wherelamb); } public IQueryable LoadEntities(Expression> whereLambda) { return _repository.LoadEntities(whereLambda); } public IQueryable LoadPageEntities(int pageSize, int pageIndex, out int total, Expression> whereLambda, Expression> orderbyLambda, bool isAsc) { return _repository.LoadPageEntities(pageSize, pageIndex, out total, whereLambda, orderbyLambda, isAsc); } public int SaveChange() { return _repository.SaveChange(); } public bool Update(T entity, bool isSaveChage = true) { return _repository.Update(entity, isSaveChage); } public int Add(T entity, bool isSaveChage = true) { return _repository.Add(entity, isSaveChage = true); } public int Delete(T entity, bool isSaveChage = true) { return _repository.Delete(entity, isSaveChage); } public int Delete(params int[] ids) { return _repository.Delete(ids); } public void Dispose() { _repository.Dispose(); } } }