public static IEnumerable <TEntity> GetItemsList <TEntity>(Expression <Func <TEntity, bool> > predicate) where TEntity : class, new() { IEnumerable <TEntity> list = null; using (UnitOfWork.UnitOfWork unitOfWork = new UnitOfWork.UnitOfWork(DBContext_External)) list = unitOfWork.GetAllEntities <TEntity>(predicate); return(list); }
//public static List<TEntity> GetStaticItemsList<TEntity>() // where TEntity : IDBCommon //{ // return (List<TEntity>) entity.ReGenerateList(); //} public static IEnumerable <TEntity> GetItemsList <TEntity>() where TEntity : class, IDBCommon, new() { IEnumerable <TEntity> itemList; using (UnitOfWork.UnitOfWork unitOfWork = new UnitOfWork.UnitOfWork(DBContext_External)) itemList = unitOfWork.GetAllEntities <TEntity>(item => item.IsOnDuty); return(itemList); }