public virtual int Count(Expression <Func <TEntityDTO, bool> > where)
        {
            int result;

            if (where != null)
            {
                result = Query.Count(where);
            }
            else
            {
                result = DataServiceQuery.Count();
            }

            return(result);
        }
Example #2
0
        public virtual int Count(Expression <Func <TEntityDTO, bool> > where)
        {
            int result;

            Filter(where);

            if (where != null)
            {
                result = Container.CreateQuery <TEntityDTO>(EntitySetName).AsQueryable <TEntityDTO>().Count(where);
            }
            else
            {
                result = DataServiceQuery.Count();
            }

            return(result);
        }
        public virtual int Count(string where, object[] args = null)
        {
            int result;

            if (!String.IsNullOrEmpty(where))
            {
                if (args != null)
                {
                    result = Query.Where(where, args).Count();
                }
                else
                {
                    result = Query.Where(where).Count();
                }
            }
            else
            {
                result = DataServiceQuery.Count();
            }

            return(result);
        }
Example #4
0
        public virtual int Count(string where, object[] args = null)
        {
            int result;

            Filter(ref where, ref args);

            if (!String.IsNullOrEmpty(where))
            {
                if (args != null)
                {
                    result = Container.CreateQuery <TEntityDTO>(EntitySetName).AsQueryable <TEntityDTO>().Where(where, args).Count();
                }
                else
                {
                    result = Container.CreateQuery <TEntityDTO>(EntitySetName).AsQueryable <TEntityDTO>().Where(where).Count();
                }
            }
            else
            {
                result = DataServiceQuery.Count();
            }

            return(result);
        }
Example #5
0
 public virtual int CountAll()
 {
     return(DataServiceQuery.Count());
 }