Beispiel #1
0
        /// <summary>
        /// Finds record Count with the specified criteria
        /// </summary>
        /// <param name="predicate">Criteria to match on</param>
        /// <returns>Total co of Recors</returns>
        public int GetCount1(string filterExpression)
        {
            if (!String.IsNullOrWhiteSpace(filterExpression))
            {
                if (filterExpression.Contains("like"))
                {
                    string[]       srcString = filterExpression.Split(' ');
                    IQueryable <T> list      = null;
                    list = _objectSet.Contains(srcString[0], srcString[2]);

                    string whereExpression = GetWhereExpression(filterExpression);
                    if (!whereExpression.Contains(("like")))
                    {
                        return(list.Where(whereExpression).Count());
                    }
                    else
                    {
                        return(list.Count());
                    }
                }
                else
                {
                    return(_objectSet.Where(filterExpression).Count());
                }
            }
            else
            {
                return(_objectSet.Count());
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets records count
        /// </summary>
        /// <returns>Total record count in the specified entity</returns>
        public int Count <T>() where T : EntityObject
        {
            IObjectSet <T> objectSet = context.CreateObjectSet <T>();

            return(objectSet.Count());
        }
Beispiel #3
0
 public int Count(Expression <Func <T, bool> > where)
 {
     return(_objectSet.Count(where));
 }
Beispiel #4
0
 public int Count()
 {
     return(_objectSet.Count());
 }
Beispiel #5
0
 public int Count(Func <T, bool> predicate)
 {
     return(_objectSet.Count(predicate));
 }
Beispiel #6
0
 public virtual int Count()
 {
     return(_objectSet.Count());
 }