private ODataQueryCriteria Desrialize(IValueProvider values)
        {
            var criteria = new ODataQueryCriteria();

            var orderBy = values.GetValue("$orderby");
            if (orderBy != null)
            {
                criteria.OrderBy = orderBy.AttemptedValue;
            }

            var filter = values.GetValue("$filter");
            if (filter != null)
            {
                criteria.Filter = filter.AttemptedValue;
            }

            ParsePagingInfo(values, criteria);

            var expand = values.GetValue("$expand");
            if (expand != null)
            {
                criteria.Expand = expand.AttemptedValue;
            }

            return criteria;
        }
Пример #2
0
        private ODataQueryCriteria Desrialize(IValueProvider values)
        {
            var criteria = new ODataQueryCriteria();

            var orderBy = values.GetValue("$orderby");

            if (orderBy != null)
            {
                criteria.OrderBy = orderBy.AttemptedValue;
            }

            var filter = values.GetValue("$filter");

            if (filter != null)
            {
                criteria.Filter = filter.AttemptedValue;
            }

            ParsePagingInfo(values, criteria);

            var expand = values.GetValue("$expand");

            if (expand != null)
            {
                criteria.Expand = expand.AttemptedValue;
            }

            return(criteria);
        }
        private static void ParsePagingInfo(IValueProvider values, ODataQueryCriteria criteria)
        {
            var pn = values.GetValue("$pageNumber");
            var tc = values.GetValue("$inlinecount");
            if (pn != null || tc != null)
            {
                var pageNumber = pn != null ? (int)pn.ConvertTo(typeof(int)) : 1;
                var needCount = tc != null && !string.IsNullOrWhiteSpace(tc.AttemptedValue);

                var ps = values.GetValue("$pageSize");
                int pageSize = ps != null ? (int)ps.ConvertTo(typeof(int)) : 10;

                var pagingInfo = new PagingInfo(pageNumber, pageSize, needCount);
                criteria.PagingInfo = pagingInfo;
            }
        }
Пример #4
0
        private static void ParsePagingInfo(IValueProvider values, ODataQueryCriteria criteria)
        {
            var pn = values.GetValue("$pageNumber");
            var tc = values.GetValue("$inlinecount");

            if (pn != null || tc != null)
            {
                var pageNumber = pn != null ? (long)pn.ConvertTo(typeof(long)) : 1;
                var needCount  = tc != null && !string.IsNullOrWhiteSpace(tc.AttemptedValue);

                var ps       = values.GetValue("$pageSize");
                int pageSize = ps != null ? (int)ps.ConvertTo(typeof(int)) : 10;

                var pagingInfo = new PagingInfo(pageNumber, pageSize, needCount);
                criteria.PagingInfo = pagingInfo;
            }
        }
Пример #5
0
        public virtual RoleList GetByRealDataId(string[] ids)
        {
            if (ids.Length > 0)
            {
                ODataQueryCriteria criteria = new ODataQueryCriteria();

                for (int i = 0; i < ids.Length; i++)
                {
                    string id = ids[i];
                    criteria.Filter = " WF_REALDATAID eq " + id;
                    if (i < ids.Length - 1)
                    {
                        criteria.Filter = " or ";
                    }
                }
                return((RoleList)this.GetBy(criteria));
            }
            else
            {
                return(new RoleList());
            }
        }
Пример #6
0
        protected virtual ODataQueryCriteria Desrialize(IValueProvider values)
        {
            var criteria = new ODataQueryCriteria();

            var orderBy = values.GetValue("$orderby");

            if (orderBy != null)
            {
                criteria.OrderBy = orderBy.AttemptedValue;
            }

            var filter = values.GetValue("$filter");

            if (filter != null)
            {
                criteria.Filter = filter.AttemptedValue;
            }

            ParsePagingInfo(values, criteria);

            var expand = values.GetValue("$expand");

            if (expand != null)
            {
                criteria.Expand = expand.AttemptedValue;
            }

            var markTreeFullLoaded = values.GetValue("$markTreeFullLoaded");

            if (markTreeFullLoaded != null)
            {
                criteria.MarkTreeFullLoaded = true;
            }

            return(criteria);
        }
Пример #7
0
 private static TestUserList QueryUserList(ODataQueryCriteria criteria)
 {
     return(RF.ResolveInstance <TestUserRepository>().GetBy(criteria) as TestUserList);
 }
Пример #8
0
 private static TestUserList QueryUserList(ODataQueryCriteria criteria)
 {
     return(RF.Concrete <TestUserRepository>().GetBy(criteria) as TestUserList);
 }