Exemple #1
0
        public virtual IList <T> Get(int skipCount, int takeCount, string orderType = null, SortingOrder sortingOrder = SortingOrder.ASC)
        {
            string orderValue = orderType ?? "Id";

            //try
            //{
            //    orderValue = FindProperty(typeof(T), orderType);
            //}
            //catch (ArgumentNullException)
            //{
            //    orderValue = "Id";
            //    //throw new ArgumentException("The property does not exist", e);
            //}

            return(DBConnection.Query <T>(SelectAllWithPaging(orderValue, sortingOrder.ToString()), new { OffsetCount = skipCount, FetchedElements = takeCount }).ToList());
        }
Exemple #2
0
        private void RefreshSorting()
        {
            Comparison <WeakReference <IBaseRefPool> > compareFunc = (x, y) => 0;

            switch (m_SortingOrder)
            {
            case SortingOrder.ObjectType:
                compareFunc = ComparePoolObjectType;
                break;

            case SortingOrder.DropCount:
            case SortingOrder.CreateCount:
            case SortingOrder.AcquireCount:
            case SortingOrder.ReleaseCount:
                compareFunc = (x, y) => ComparePoolObjectStatistics(x, y, m_SortingOrder.ToString());
                break;
            }

            m_PoolWeakRefs.Sort(compareFunc);
            m_FilteredPoolWeakRefs.Sort(compareFunc);
        }
Exemple #3
0
 string GenerateSortingFieldAndOrder(SortingMitkanimField sortingName, SortingOrder sortingOrder)
 {
     return(sortingName.ToString() + " " + sortingOrder.ToString());
 }