} = 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); }
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()); }
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)); } }
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)); } }
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()); }
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>())); }