Esempio n. 1
0
        } = 0;                                           //the query result count

        private static int GetCount <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query) where DBEntity : DbContext where TBEntity : class
        {
            int count = 0;
            IQueryable <TBEntity> source = EF_Helper_DG <DBEntity> .SelectAll <TBEntity>(query.BuildQueryFunc <TBEntity>(), out count);

            return(count);
        }
Esempio n. 2
0
        private static object GetEntities <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query) where DBEntity : DbContext where TBEntity : class
        {
            IQueryable <TBEntity> source = null;
            int count = 0;

            source = EF_Helper_DG <DBEntity> .SelectAll(query.BuildQueryFunc <TBEntity>(), out count);

            _totalCount = count;
            return(source.ToList());
        }
Esempio n. 3
0
 public Boolean Delete <TEntity2>(TEntity2 entity) where TEntity2 : class
 {
     if (this == null)
     {
         throw new ArgumentNullException(nameof(TEntity));
     }
     lock (locker)
     {
         return(EF_Helper_DG <DataBaseEntity> .Delete(entity));
     }
 }
Esempio n. 4
0
 public void Update_ThreadPool <TEntity2>(TEntity2 entity) where TEntity2 : class
 {
     if (this == null)
     {
         throw new ArgumentNullException(nameof(TEntity));
     }
     lock (locker)
     {
         ThreadPool.QueueUserWorkItem(obj => EF_Helper_DG <DataBaseEntity> .Update(entity));
     }
 }
Esempio n. 5
0
        private static object GetEntitiesPaging <DBEntity, TBEntity, TKey>(WcfQueryObject <DBEntity, TBEntity> query, Expression <Func <TBEntity, TKey> > orderBy) where DBEntity : DbContext where TBEntity : class
        {
            IQueryable <TBEntity> source = null;
            int count = 0;

            if (query.PageIndex >= 0 && query.PageSize > 0)
            {
                source = EF_Helper_DG <DBEntity> .SelectAllPaging(query.PageIndex, query.PageSize, orderBy, query.BuildQueryFunc <TBEntity>(), out count, query.IsDESC);
            }
            else
            {
                source = EF_Helper_DG <DBEntity> .SelectAll(orderBy, query.BuildQueryFunc <TBEntity>(), out count, query.IsDESC);
            }
            _totalCount = count;
            return(source.ToList());
        }
Esempio n. 6
0
 private static object GetEntity <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query) where DBEntity : DbContext where TBEntity : class
 {
     return(EF_Helper_DG <DBEntity> .SelectSingle(query.BuildQueryFunc <TBEntity>()));
 }