예제 #1
0
        } = 0;                                           //the query result count

        private static int GetCount <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query) where DBEntity : Bankinate where TBEntity : class
        {
            using (var db = Activator.CreateInstance <DBEntity>())
            {
                return(db.QueryCount(query.BuildQueryFunc <TBEntity>()));
            }
        }
예제 #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());
        }
예제 #3
0
        private static object GetEntities <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query) where DBEntity : Bankinate where TBEntity : class
        {
            List <TBEntity> source = null;

            using (var db = Activator.CreateInstance <DBEntity>())
            {
                source = db.QueryEntities(query.BuildQueryFunc <TBEntity>());
            }
            _totalCount = source.Count;
            return(source);
        }
예제 #4
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());
        }
예제 #5
0
        private static object GetEntitiesPaging <DBEntity, TBEntity>(WcfQueryObject <DBEntity, TBEntity> query, Expression <Func <TBEntity, object> > orderBy) where DBEntity : Bankinate where TBEntity : class
        {
            List <TBEntity> source = null;
            int             count  = 0;

            using (var db = Activator.CreateInstance <DBEntity>())
            {
                if (query.PageIndex >= 0 && query.PageSize > 0)
                {
                    source = db.QueryEntitiesPaging(query.PageIndex, query.PageSize, orderBy, query.BuildQueryFunc <TBEntity>(), out count, query.IsDESC);
                }
                else
                {
                    source = db.QueryEntitiesPaging(1, 10, orderBy, query.BuildQueryFunc <TBEntity>(), out count, query.IsDESC);
                }
            }
            _totalCount = source.Count;
            return(source);
        }
예제 #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>()));
 }
예제 #7
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);
        }