• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# OrderBy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中OrderBy的典型用法代码示例。如果您正苦于以下问题:C# OrderBy类的具体用法?C# OrderBy怎么用?C# OrderBy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OrderBy类属于命名空间,在下文中一共展示了OrderBy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: QueryData

 /// <summary>
 /// Default constructor
 /// </summary>
 public QueryData()
 {
     fields = new List<string>();
     conditions = new List<string>();
     groupBy = new GroupBy();
     orderBy = new OrderBy();
 }
开发者ID:thinkingmedia,项目名称:gems,代码行数:10,代码来源:QueryData.cs


示例2: GetParametersString

 public static string GetParametersString(int page, SortBy sort, OrderBy direction)
 {
     return string.Format("page={0}&sort={1}&direction={2}",
                          page,
                          sort.GetText(),
                          direction.GetText());
 }
开发者ID:ninjaAB,项目名称:NGitHub,代码行数:7,代码来源:ApiHelpers.cs


示例3: RegisterButton

 public OrderByService RegisterButton(LinkButton button, OrderBy orderBy)
 {
     button.Click += delegate { ButtonClicked(orderBy); };
     SetCssClass(button, orderBy);
     Changed += delegate { SetCssClass(button, orderBy); };
     return this;
 }
开发者ID:teamaton,项目名称:speak-lib,代码行数:7,代码来源:OrderByService.cs


示例4: ClassAdvanced

 public ActionResult ClassAdvanced(string searchString, int page, SearchBy searchBy, OrderBy orderBy, string universityId)
 {
     UserInformationModel<User> myUserInformation = GetUserInformatonModel();
     searchString = MassageSearchString(searchString);
     SearchResultsModel mySearchResults = theSearchService.GetClassSearchResults(myUserInformation, searchString, page, searchBy, orderBy, universityId);
     return View("Results", mySearchResults);
 }
开发者ID:henryksarat,项目名称:Have-A-Voice,代码行数:7,代码来源:SearchController.cs


示例5: SearchPage

 public SearchPage(List<LaunchData> launchList, OrderBy order)
 {
     Title = "Launch list";
     Context = new SearchViewModel(launchList, order);
     Context.SearchResult.ItemTapped += SearchResult_ItemTapped;
     BackgroundColor = Theme.BackgroundColor;
     Content = GenerateView();
 }
开发者ID:threezool,项目名称:LaunchPal,代码行数:8,代码来源:SearchPage.cs


示例6: ReorderElements

 public static XContainer ReorderElements(this XContainer root, OrderBy reorderElementsBy)
 {
     if (reorderElementsBy.HasFlag(OrderBy.MinX)) OrderByMinX(root);
     if (reorderElementsBy.HasFlag(OrderBy.MinY)) OrderByMinY(root);
     if (reorderElementsBy.HasFlag(OrderBy.ChildMinY)) OrderByChildMinY(root);
     if (reorderElementsBy.HasFlag(OrderBy.Id)) OrderById(root);
     else if (reorderElementsBy.HasFlag(OrderBy.IdDesc)) OrderByIdDesc(root);
     return root;
 }
开发者ID:MerrittMelker,项目名称:Ks.Ts.SeatsSvgHydrator,代码行数:9,代码来源:XContainerReorderElementsExtensions.cs


示例7: MessageOrderBy

 public MessageOrderBy()
 {
     Id = new OrderBy("Id", this);
     From = new OrderBy("FromType", this);
     To = new OrderBy("ToType", this);
     Type = new OrderBy("Type", this);
     Status = new OrderBy("Status", this);
     DateCreated = new OrderBy("DateCreated", this);
 }
开发者ID:teamaton,项目名称:speak-lib,代码行数:9,代码来源:MessageOrderBy.cs


示例8: OrderByToString

 private static string OrderByToString(OrderBy orderBy)
 {
     switch (orderBy)
     {
         case OrderBy.CreateDate:
             return "create_date";
         case OrderBy.RuReleaseDate:
             return "ru_releae_date";
         default:
             return "release_date";
     }
 }
开发者ID:pinger,项目名称:cinemate-dotnet-api,代码行数:12,代码来源:UrlFactory.cs


示例9: GetGroupBySumStatement

 public virtual SqlStatement GetGroupBySumStatement(Condition iwc, OrderBy order, string groupbyColumnName, string sumColumnName)
 {
     var builder = new SelectStatementBuilder(Context.Info.From, order, null);
     builder.Where.Conditions = iwc;
     var list = groupbyColumnName.Split(',');
     foreach (string s in list)
     {
         builder.Keys.Add(new KeyValuePair<string, string>(s, null));
         builder.SetAsGroupBySum(groupbyColumnName, sumColumnName);
     }
     return builder.ToSqlStatement(Context);
 }
开发者ID:991899783,项目名称:DbEntry,代码行数:12,代码来源:QueryComposer.cs


示例10: GetMovieListUrl

 public static string GetMovieListUrl(DateTime fromDate, DateTime toDate, OrderBy orderBy, bool ascOrder, int pageNumber, int itemsPerPage, string genre, string country)
 {
     var sb = new StringBuilder(string.Format("&from={0}&to={1}&order_by={2}&order={3}&page={4}&per_page={5}", fromDate, toDate, OrderByToString(orderBy), ascOrder ? "asc" : "desc", pageNumber, itemsPerPage));
     if (!string.IsNullOrEmpty(genre))
     {
         sb.Append(string.Format("&genre={0}", genre));
     }
     if (!string.IsNullOrEmpty(country))
     {
         sb.Append(string.Format("&country={0}", country));
     }
     return ConcatBase(Settings.Default.MovieListUrlPart, sb);
 }
开发者ID:pinger,项目名称:cinemate-dotnet-api,代码行数:13,代码来源:UrlFactory.cs


示例11: Get

        public RestAPIResponse Get(string id = null, string hash = null, string historicsId = null, int? page = null, int? perPage = null, OrderBy? orderBy = null, OrderDirection? orderDirection = null, bool? includeFinished = null)
        {
            //Contract.Requires<ArgumentException>((id != null) ? id.Trim().Length > 0 : true);
            //Contract.Requires<ArgumentException>((id != null) ? Constants.SUBSCRIPTION_ID_FORMAT.IsMatch(id) : true, Messages.INVALID_SUBSCRIPTION_ID);
            //Contract.Requires<ArgumentException>((hash != null) ? hash.Trim().Length > 0 : true);
            //Contract.Requires<ArgumentException>((hash != null) ? Constants.STREAM_HASH_FORMAT.IsMatch(hash) : true, Messages.INVALID_STREAM_HASH);
            //Contract.Requires<ArgumentException>((historicsId != null) ? historicsId.Trim().Length > 0 : true);
            //Contract.Requires<ArgumentException>((historicsId != null) ? Constants.HISTORICS_ID_FORMAT.IsMatch(historicsId) : true, Messages.INVALID_HISTORICS_ID);
            //Contract.Requires<ArgumentException>((page.HasValue) ? page.Value > 0 : true);
            //Contract.Requires<ArgumentException>((perPage.HasValue) ? perPage.Value > 0 : true);

            return _client.GetRequest().Request("push/get", new { id = id, hash = hash, historics_id = historicsId, page = page, per_page = perPage, order_by = orderBy, order_dir = orderDirection, include_finished = includeFinished });
        }
开发者ID:sonrnews,项目名称:datasift-dotnet,代码行数:13,代码来源:Push.cs


示例12: Down

 //Возвращает текущий список
 //Задаем сортировку/порядок/отмену
 public List<Item> Down(string iD, OrderBy op)
 {
     switch (op)
     {
         case OrderBy.None:
             CurrentNode.Push(_treeMenu.Find(z => z.Id == iD).Children
                 .Select(p => new Item { ItemLine = p.Value.ItemLine, Id = p.Value.Id }).ToList());
             break;
             case OrderBy.Orderby:
             CurrentNode.Push(_treeMenu.Find(z => z.Id == iD).Children.OrderBy(z => z.Value.ItemLine.ElementAt(2))
                .Select(p => new Item { ItemLine = p.Value.ItemLine, Id = p.Value.Id }).ToList());
             break;
         case OrderBy.Descending:
             CurrentNode.Push(_treeMenu.Find(z => z.Id == iD).Children.OrderByDescending(z => z.Value.ItemLine.ElementAt(2))
                 .Select(p => new Item { ItemLine = p.Value.ItemLine, Id = p.Value.Id }).ToList());
             break;
     }
     var c = CurrentNode.Count;
     return CurrentNode.Peek();
 }
开发者ID:pmaxim,项目名称:Solution-ORDERMAN-RecordSet,代码行数:22,代码来源:MenuXml.cs


示例13: CreateDimensionAttributeForLevel

        //--------------------
        public bool CreateDimensionAttributeForLevel(Dimension dimension, DataSourceView dataSourceView,
            String levelId, String levelName, String tableName, String keyColumn, String nameColumn,
            AttributeUsage attributeUsage, OrderBy orderBy, AttributeType attribType, bool visible)
        {
            if (dimension.Attributes == null)
            {
                return false;
            }

            DimensionAttribute dimAttrib;
            if (!dimension.Attributes.Contains(levelId))
            {
                dimAttrib = dimension.Attributes.Add(levelName, levelId);
                dimAttrib.Usage = attributeUsage;
                dimAttrib.OrderBy = orderBy;
                dimAttrib.Type = attribType;
                dimAttrib.AttributeHierarchyVisible = true;// visible;
                dimAttrib.AttributeHierarchyOptimizedState = OptimizationType.NotOptimized;
                dimAttrib.AttributeHierarchyOrdered = true;
                dimAttrib.IsAggregatable = true;
                //设置MembersWithDataCaption会导致当前粒度在子粒度中存在,形如"XXXX(All)",因此注释掉
                //if (attributeUsage == AttributeUsage.Parent)
                //{
                //    dimAttrib.MembersWithDataCaption = "*(All)";
                //}
                dimAttrib.MembersWithData = MembersWithData.NonLeafDataHidden;

                DataItem diKey = CreateDataItem(dataSourceView, tableName, keyColumn);
                dimAttrib.KeyColumns.Add(diKey);
                if (!String.IsNullOrEmpty(nameColumn))
                {
                    DataItem diName = CreateDataItem(dataSourceView, tableName, nameColumn);
                    dimAttrib.NameColumn = diName;

                    DataItem diValue = CreateDataItem(dataSourceView, tableName, nameColumn);
                    dimAttrib.ValueColumn = diValue;
                }
                return true;
            }
            return true;
        }
开发者ID:piaolingzxh,项目名称:Justin,代码行数:42,代码来源:SSASFactory.cs


示例14: GetFolders

        public List<Folder> GetFolders(object parentId, OrderBy orderBy, FilterType filterType, Guid subjectID, string searchText)
        {
            var folders = GetFolders(parentId).AsEnumerable(); //TODO:!!!
            //Filter
            switch (filterType)
            {
                case FilterType.ByUser:
                    folders = folders.Where(x => x.CreateBy == subjectID);
                    break;

                case FilterType.ByDepartment:
                    folders = folders.Where(x => CoreContext.UserManager.IsUserInGroup(x.CreateBy, subjectID));
                    break;
            }

            if (!string.IsNullOrEmpty(searchText))
                folders = folders.Where(x => x.Title.IndexOf(searchText, StringComparison.OrdinalIgnoreCase) != -1);

            if (orderBy == null) orderBy = new OrderBy(SortedByType.DateAndTime, false);

            switch (orderBy.SortedBy)
            {
                case SortedByType.Author:
                    folders = orderBy.IsAsc ? folders.OrderBy(x => x.CreateBy) : folders.OrderByDescending(x => x.CreateBy);
                    break;
                case SortedByType.AZ:
                    folders = orderBy.IsAsc ? folders.OrderBy(x => x.Title) : folders.OrderByDescending(x => x.Title);
                    break;
                case SortedByType.DateAndTime:
                    folders = orderBy.IsAsc ? folders.OrderBy(x => x.CreateOn) : folders.OrderByDescending(x => x.CreateOn);
                    break;
                default:
                    folders = orderBy.IsAsc ? folders.OrderBy(x => x.Title) : folders.OrderByDescending(x => x.Title);
                    break;
            }

            return folders.ToList();
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:38,代码来源:SharpBoxFolderDao.cs


示例15: PopulateUOMIDDropDownList

        // Fill the UOMID list.
        protected virtual void PopulateUOMIDDropDownList(string selectedValue, int maxItems)
        {
            this.UOMID.Items.Clear();

            // 1. Setup the static list items

            // Add the Please Select item.
            this.UOMID.Items.Insert(0, new ListItem(this.Page.GetResourceValue("Txt:PleaseSelect", "FPCEstimate"), "--PLEASE_SELECT--"));

            // 2. Set up the WHERE and the ORDER BY clause by calling the CreateWhereClause_UOMIDDropDownList function.
            // It is better to customize the where clause there.

            WhereClause wc = CreateWhereClause_UOMIDDropDownList();

            // Create the ORDER BY clause to sort based on the displayed value.

            OrderBy orderBy = new OrderBy(false, false);
                          orderBy.Add(UOMTable.UOMName, OrderByItem.OrderDir.Asc);

            System.Collections.Generic.IDictionary<string, object> variables = new System.Collections.Generic.Dictionary<string, object> ();

            // 3. Read a total of maxItems from the database and insert them into the UOMIDDropDownList.
            UOMRecord[] itemValues  = null;
            if (wc.RunQuery)
            {
                int counter = 0;
                int pageNum = 0;
                FormulaEvaluator evaluator = new FormulaEvaluator();
                do
                {
                    itemValues = UOMTable.GetRecords(wc, orderBy, pageNum, maxItems);
                    foreach (UOMRecord itemValue in itemValues)
                    {
                        // Create the item and add to the list.
                        string cvalue = null;
                        string fvalue = null;
                        if (itemValue.UOMIDSpecified)
                        {
                            cvalue = itemValue.UOMID.ToString().ToString();
                            if (counter < maxItems && this.UOMID.Items.FindByValue(cvalue) == null)
                            {

                                Boolean _isExpandableNonCompositeForeignKey = ScopeTable.Instance.TableDefinition.IsExpandableNonCompositeForeignKey(ScopeTable.UOMID);
                                if(_isExpandableNonCompositeForeignKey && ScopeTable.UOMID.IsApplyDisplayAs)
                                    fvalue = ScopeTable.GetDFKA(itemValue, ScopeTable.UOMID);
                                if ((!_isExpandableNonCompositeForeignKey) || (String.IsNullOrEmpty(fvalue)))
                                    fvalue = itemValue.Format(UOMTable.UOMName);

                                if (fvalue == null || fvalue.Trim() == "")
                                    fvalue = cvalue;
                                ListItem newItem = new ListItem(fvalue, cvalue);
                                this.UOMID.Items.Add(newItem);
                                counter += 1;
                            }
                        }
                    }
                    pageNum++;
                }
                while (itemValues.Length == maxItems && counter < maxItems);
            }

            // 4. Set the selected value (insert if not already present).

            if (selectedValue != null &&
                selectedValue.Trim() != "" &&
                !MiscUtils.SetSelectedValue(this.UOMID, selectedValue) &&
                !MiscUtils.SetSelectedDisplayText(this.UOMID, selectedValue))
            {

                // construct a whereclause to query a record with UOM.UOMID = selectedValue

                CompoundFilter filter2 = new CompoundFilter(CompoundFilter.CompoundingOperators.And_Operator, null);
                WhereClause whereClause2 = new WhereClause();
                filter2.AddFilter(new BaseClasses.Data.ColumnValueFilter(UOMTable.UOMID, selectedValue, BaseClasses.Data.BaseFilter.ComparisonOperator.EqualsTo, false));
                whereClause2.AddFilter(filter2, CompoundFilter.CompoundingOperators.And_Operator);

                // Execute the query
                try
                {
                UOMRecord[] rc = UOMTable.GetRecords(whereClause2, new OrderBy(false, false), 0, 1);
                System.Collections.Generic.IDictionary<string, object> vars = new System.Collections.Generic.Dictionary<string, object> ();
                    // if find a record, add it to the dropdown and set it as selected item
                    if (rc != null && rc.Length == 1)
                    {

                        string fvalue = ScopeTable.UOMID.Format(selectedValue);

                        ListItem item = new ListItem(fvalue, selectedValue);
                        item.Selected = true;
                        this.UOMID.Items.Add(item);
                    }
                }
                catch
                {
                }

            }
        }
开发者ID:ciswebb,项目名称:FPC-Estimate-App,代码行数:99,代码来源:EditScope.Controls.cs


示例16: ListCurrentOrders

 public BetfairServerResponse<CurrentOrderSummaryReport> ListCurrentOrders(
     ISet<string> betIds = null,
     ISet<string> marketIds = null,
     OrderProjection? orderProjection = null,
     TimeRange placedDateRange = null,
     TimeRange dateRange = null,
     OrderBy? orderBy = null,
     SortDir? sortDir = null,
     int? fromRecord = null,
     int? recordCount = null)
 {
     return client.ListCurrentOrders(
         betIds,
         marketIds,
         orderProjection,
         placedDateRange,
         dateRange,
         orderBy,
         sortDir,
         fromRecord,
         recordCount).Result;
 }
开发者ID:hugocorreia77,项目名称:betfairng,代码行数:22,代码来源:BetfairClientSync.cs


示例17: GetValues

        public static String[] GetValues(
		BaseColumn col,
		BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int maxItems)
        {
            // Create the filter list.
            SqlBuilderColumnSelection retCol = new SqlBuilderColumnSelection(false, true);
            retCol.AddColumn(col);

            return UsersTable.Instance.GetColumnValues(retCol, join, where.GetFilter(), null, orderBy, BaseTable.MIN_PAGE_NUMBER, maxItems);
        }
开发者ID:ciswebb,项目名称:FPC-Estimate-App,代码行数:13,代码来源:BaseUsersTable.cs


示例18: GetSum

        public static string GetSum(
		BaseColumn col,
		BaseFilter join, 
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            SqlBuilderColumnSelection colSel = new SqlBuilderColumnSelection(false, false);
            colSel.AddColumn(col, SqlBuilderColumnOperation.OperationType.Sum);

            return UsersTable.Instance.GetColumnStatistics(colSel, join, where.GetFilter(), null, orderBy, pageIndex, pageSize);
        }
开发者ID:ciswebb,项目名称:FPC-Estimate-App,代码行数:13,代码来源:BaseUsersTable.cs


示例19: GetRecords

        public static UsersRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize,
		ref int totalRecords)
        {
            ArrayList recList = UsersTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize, ref totalRecords);

            return (UsersRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.UsersRecord"));
        }
开发者ID:ciswebb,项目名称:FPC-Estimate-App,代码行数:12,代码来源:BaseUsersTable.cs


示例20: GetSelectStatementBuilder

 public override SelectStatementBuilder GetSelectStatementBuilder(FromClause from, Condition iwc, OrderBy oc, Range lc, bool isDistinct, bool noLazy, Type returnType, string colName)
 {
     return base.GetSelectStatementBuilder(from, iwc && _colExp, oc, lc, isDistinct, noLazy, returnType, colName);
 }
开发者ID:991899783,项目名称:DbEntry,代码行数:4,代码来源:SoftDeleteQueryComposer.cs



注:本文中的OrderBy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OrderByQueryOption类代码示例发布时间:2022-05-24
下一篇:
C# Order类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap