当前位置: 首页>>代码示例>>C#>>正文


C# List.Where方法代码示例

本文整理汇总了C#中Entities.List.Where方法的典型用法代码示例。如果您正苦于以下问题:C# List.Where方法的具体用法?C# List.Where怎么用?C# List.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entities.List的用法示例。


在下文中一共展示了List.Where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetContent

 private Content GetContent(object obj)
 {
     var text = obj as string;
     var contentList = new List<Content>() { Content1, Content2, Content3, Content4 };
     var content = contentList.Where(c => c.Value == text).FirstOrDefault();
     return content;
 }
开发者ID:bizmonger,项目名称:ClipPaste,代码行数:7,代码来源:ViewModel.support.cs

示例2: GetByYear

 public  List<Book> GetByYear(int Year)
   {
       List<Book> books = new List<Book>();
       books = GetAll();
       return books.Where(x => x.YearOfCreating
       == Year).ToList(); ;
   }
开发者ID:PavelZakharenko,项目名称:BSU.ASP.1501.DAY5.Zaharenko,代码行数:7,代码来源:BinaryFormater.cs

示例3: GetByTitle

       public List<Book> GetByTitle(string Title)
        {
            List<Book> books = new List<Book>();
            books = GetAll();

            return books.Where(x => x.Title == Title).ToList(); ;
        }
开发者ID:PavelZakharenko,项目名称:BSU.ASP.1501.DAY5.Zaharenko,代码行数:7,代码来源:BinaryFormater.cs

示例4: Select

        public IList<CustomProcessTransitionByEntity> Select(CustomProcessTransitionByEntity data)
        {
            IList<CustomProcessTransitionByEntity> datos = new List<CustomProcessTransitionByEntity>();
            datos = GetHsql(data).List<CustomProcessTransitionByEntity>();
            if (!Factory.IsTransactional)
                Factory.Commit();

            try { datos = datos.Where(f => f.GetType() == typeof(CustomProcessTransitionByEntity)).ToList(); }
            catch { }
            return datos;

        }
开发者ID:erwin-hamid,项目名称:LogPro,代码行数:12,代码来源:DaoCustomProcessTransitionByEntity.cs

示例5: GetDistrListWithoutUsers

 public List<DistributeList> GetDistrListWithoutUsers(List<DistributeList> lists, User selectedUser)
 {
     var selectedLists =
         lists.Where(list => list.SubscribersList.TrueForAll(user => user.Id != selectedUser.Id));
     return selectedLists.ToList();
 }
开发者ID:Tsvetkovv,项目名称:DistributeLists,代码行数:6,代码来源:BLL.cs

示例6: GetAllEquips

        public List<Equipment> GetAllEquips()
        {
            List<Equipment> Equipments = new List<Equipment>();
            Equipments.AddRange(new Equipment[] { this.Necklace, this.Ring, this.Head, this.Body, this.Hand, this.Cape, this.Feet, this.Charm, this.Mirror });

            var equips = Equipments.Where(x => x != null);

            return equips.ToList();
        }
开发者ID:zarut,项目名称:xiah-gcf-emulator,代码行数:9,代码来源:Entities.cs

示例7: GenerateMenuConsultant

 private void GenerateMenuConsultant(List<MenuLeft> menus, StringBuilder htmlMenu, StringBuilder htmlMenuDropdown, int subType)
 {
     string caption = "Phần hiển thị chung cho Kiến trúc và Nội thất";
     var parent = menus.Where(t => t.SubType == 2).ToList();
     GenerateMenuConsultant(parent, htmlMenu, caption);
     switch (subType)
     {
         case 0:
         case 1:
             parent = menus.Where(t => t.SubType == subType).OrderByDescending(t => t.SubType).ToList();
             if(parent.Count == 0)
                 break;
             caption = string.Format("Các câu hỏi tư vấn phần {0}", subType == 0 ? "Kiến trúc" : "Nội thất");
             GenerateMenuConsultant(parent, htmlMenu, caption);
             break;
     }
     parent = menus.Where(t => t.ParentId == null && t.SubType == subType).OrderBy(t => t.Position).ToList();
     GenerateMenuDropdow(parent, htmlMenuDropdown);
 }
开发者ID:JhackoGithub,项目名称:my-project-interior,代码行数:19,代码来源:MenuHanlder.ashx.cs

示例8: GetMenuProject

 private string GetMenuProject(List<MenuLeft> menus)
 {
     var parents = menus.Where(t => t.ParentId == null).OrderBy(t => t.Position);
     var parentses = new List<Parents>();
     foreach (var parent in parents.Where(parent => parent != null))
     {
         var menuParent = new Parents
                              {
                                  Id = parent.Id,
                                  Name = parent.Name
                              };
         var childs = menus.Where(t => t.ParentId != null && t.ParentId == parent.Id).ToList();
         if(childs.Count == 0)
         {
             menuParent.Childs = new List<Childs>();
         }
         else
         {
             foreach (var menuChild in childs.Select(child => new Childs
                                                                  {
                                                                      Id = child.Id,
                                                                      Name = child.Name
                                                                  }))
             {
                 menuParent.Childs.Add(menuChild);
             }
         }
         parentses.Add(menuParent);
     }
     object json = new
         {
             parent = parentses
         };
     var res = Utils.ConvertToJsonString(json);
     return res;
 }
开发者ID:JhackoGithub,项目名称:my-project-interior,代码行数:36,代码来源:MenuHanlder.ashx.cs

示例9: GetMenuParents

 private List<Parents> GetMenuParents(List<MenuLeft> menus)
 {
     var parentses = new List<Parents>();
     foreach (var parent in menus.Where(parent => parent != null))
     {
         var menuParent = new Parents
                              {
                                  Id = parent.Id,
                                  Name = parent.Name
                              };
         var childs = menus.Where(t => t.ParentId != null && t.ParentId == parent.Id).ToList();
         if (childs.Count == 0)
         {
             menuParent.Childs = new List<Childs>();
         }
         else
         {
             foreach (var menuChild in childs.Select(child => new Childs{ Id = child.Id, Name = child.Name}))
             {
                 menuParent.Childs.Add(menuChild);
             }
         }
         parentses.Add(menuParent);
     }
     return parentses;
 }
开发者ID:JhackoGithub,项目名称:my-project-interior,代码行数:26,代码来源:MenuHanlder.ashx.cs

示例10: GetMenuConsultant

        private string GetMenuConsultant(List<MenuLeft> menus, int subType)
        {
            var parent = menus.Where(t => t.SubType == subType).ToList();
            var commonParents = parent.Where(t => t.ParentId == null).OrderBy(t => t.Position).ToList();
            var commons = GetMenuParents(commonParents);

            var sperateParents = parent.OrderByDescending(t => t.SubType).ToList();
            var sperates = GetMenuParents(sperateParents);

            var dropdown = menus.Where(t => t.ParentId == null && t.SubType == subType).OrderBy(t => t.Position).ToList();

            object json = new
                              {
                                  commons,
                                  sperates,
                                  dropdown
                              };
            var res = Utils.ConvertToJsonString(json);
            return res;
        }
开发者ID:JhackoGithub,项目名称:my-project-interior,代码行数:20,代码来源:MenuHanlder.ashx.cs

示例11: GenerateMenuProject

        private void GenerateMenuProject(List<MenuLeft> menus, StringBuilder htmlMenu, int cateId)
        {
            htmlMenu.Append("<ul>");
            var menuParents = menus.Where(t => t.ParentId == null).OrderBy(t => t.Position);
            foreach (MenuLeft parent in menuParents.Where(parent => parent != null))
            {

                htmlMenu.AppendFormat("<li>" +
                                      "<div>" +
                                      "<div style='float: left;'>{0}</div>" +
                                      "</div>", parent.Name);
                List<MenuLeft> menuChilds = menus.Where(t => t.ParentId != null && t.ParentId == parent.Id).ToList();
                if (menuChilds.Count == 0)
                {
                    htmlMenu.Append("</li>");
                }
                else
                {
                    htmlMenu.Append("<ul>");
                    foreach (MenuLeft child in menuChilds)
                    {
                        htmlMenu.AppendFormat("<li>" +
                                              "<div>" +
                                              "<input id='rd{0}' type='radio' name='rdKind' value='{1}' {2}>" +
                                              "<label for='rd{3}'>{4}</label>" +
                                              "</div>" +
                                              "</li>",
                                              child.Id, child.Id,
                                              cateId == child.Id ? "checked='checked'" : string.Empty, child.Id,
                                              child.Name);
                    }
                    htmlMenu.Append("</ul>");
                }
            }
            htmlMenu.Append("</ul>");
        }
开发者ID:JhackoGithub,项目名称:my-project-interior,代码行数:36,代码来源:MenuHanlder.ashx.cs

示例12: ConfirmCountingTaskDocument


//.........这里部分代码省略.........

            //Ajustes Positivos en un solo documento
            if (taskList.Any(f => f.Difference > 0))
            {
                //Crear Ajustes de inventario positivos en un solo ajuste.
                postiveAdj = new Document
                {
                    DocType = new DocumentType { DocTypeID = SDocType.InventoryAdjustment },
                    CreatedBy = user,
                    Location = countTask.Location,
                    Company = countTask.Company,
                    IsFromErp = false,
                    CrossDocking = false,
                    Comment = "CountTask Posting (Postitive Adj) " + countTask.DocNumber + ", " + user,
                    Date1 = DateTime.Now,
                    CustPONumber = countTask.DocNumber,
                    Notes = WmsSetupValues.Counting_Bach
                };

                postiveAdj = DocMngr.CreateNewDocument(postiveAdj, false);
            }
            

            //Casetype
            //3. Label Contado (esperado y no Esperado)
            //4. Label Esperado no Contado Se meuve a No Count


            List<CountTaskBalance> labelsTotal, productTotal;

            try
            {

                try { labelsTotal = taskList.Where(f => f.Label != null && f.Label.LabelID > 0).ToList(); }
                catch { labelsTotal = new List<CountTaskBalance>(); }

                //LABELS
                foreach (CountTaskBalance r in labelsTotal.Where(f => f.CaseType == 4 || f.CaseType == 5 || f.CaseType == 6))
                {
                    
                    //Label Counted - Expected
                    if ((r.CaseType == 4 || r.CaseType == 5) && r.Mark == true)
                        UpdateLabelData(r.Label, r.Bin, countTask.DocNumber, active, user);

                    //Label no counted expected
                    if (r.CaseType == 6 && r.Mark == true)
                        UpdateLabelData(r.Label, NoCountBin, countTask.DocNumber, inActive, user);


                    //Hacer el ajuste de inventario si el label tiene diferencias.
                    if (r.Difference > 0 && r.Mark == true)
                        positiveLine = UpdatePositiveAdj(countTask, r, user, postiveAdj, positiveLine);

                    else if (r.Difference < 0 && r.Mark == true)
                    {
                        negativeAdj = UpdateNegativeAdj(countTask, r, user);
                        if (negativeAdj != null)
                            negativeDocs.Add(negativeAdj);
                    }

                }


                /* PRODUCTO
                 1. Ajusta las diferencias de producto en el mismo BIN (Positivo/Negativo) (Label == null && Expected > 0 && counted > 0)            
                 2. Aumenta el producto Encontrado (Ajuste Positivo) (Label == null && Expected == 0)
开发者ID:erwin-hamid,项目名称:LogPro,代码行数:67,代码来源:TransactionMngr.Tasks.cs

示例13: GetByGenre

 public List<Book> GetByGenre(string Genre)
  {
      List<Book> books = new List<Book>();
      books = GetAll();
      return books.Where(x => x.Genre == Genre).ToList(); ;
  }
开发者ID:PavelZakharenko,项目名称:BSU.ASP.1501.DAY5.Zaharenko,代码行数:6,代码来源:BinaryFormater.cs

示例14: GetByAuthor

 public List<Book> GetByAuthor(string Author)
   {
       List<Book> books = new List<Book>();
       books = GetAll();
       return books.Where(x => x.Author == Author).ToList(); ;
   }
开发者ID:PavelZakharenko,项目名称:BSU.ASP.1501.DAY5.Zaharenko,代码行数:6,代码来源:BinaryFormater.cs

示例15: GetLinesWithKitAssemblyHeaders

        private IList<DocumentLine> GetLinesWithKitAssemblyHeaders(IList<DocumentLine> shpLines)
        {
            DocumentLine ssLine = null;
            DocumentLine curLine = null;
            int kitLine;
            IList<DocumentLine> processeKits = new List<DocumentLine>();

            //Recorre los componentes para encontrar su Kit/Assembly Padre.
            foreach (DocumentLine dl in shpLines.Where(f => f.Note == "1").OrderBy(f=>f.LinkDocLineNumber))
            {
                try
                {
                    //Entrega la linea del KIT/ASSEMBLY en el Sales Order
                    kitLine = Factory.DaoDocumentLine().Select(
                        new DocumentLine
                        {
                            LineNumber = dl.LinkDocLineNumber,
                            Document = new Document { DocNumber = dl.LinkDocNumber, Company = dl.Document.Company }}
                        ).First().LinkDocLineNumber;

                    curLine = Factory.DaoDocumentLine().Select(
                        new DocumentLine {
                            LineNumber = kitLine,
                            Document = new Document { DocNumber = dl.LinkDocNumber, Company = dl.Document.Company }}
                         ).First();

                    //revisa si ese kit aun no ha sido procesado. Si fue procesado va al siguiente
                    if (processeKits.Where(f => f.LineNumber == curLine.LineNumber).Count() > 0)
                        continue;

                    processeKits.Add(curLine);
                }
                catch { continue; }


                int line = shpLines.Select(f=>f.LineNumber).Max() + 1;
                Status lineStatus = WType.GetStatus(new Status { StatusID = DocStatus.New });

                //Crea una linea para el documento de shipment
                ssLine = new DocumentLine
                {
                    Product = curLine.Product,
                    Quantity = 0, 
                    QtyAllocated = curLine.Quantity, //Guarda la cantidad a enviar al ERP para el Fulfill.
                    Unit = curLine.Unit,
                    Document = dl.Document,
                    CreationDate = DateTime.Now,
                    IsDebit = false,
                    LineNumber = line,
                    LineStatus = lineStatus,
                    Location = dl.Document.Location,
                    UnitBaseFactor = dl.Unit.BaseAmount,
                    LinkDocNumber = curLine.Document.DocNumber,
                    LinkDocLineNumber = curLine.LineNumber,
                    CreatedBy = dl.CreatedBy,
                    Note = "2",
                    Sequence = curLine.Sequence
                };

                shpLines.Add(ssLine);
                line++;
            }

            return shpLines;
        }
开发者ID:erwin-hamid,项目名称:LogPro,代码行数:65,代码来源:ErpDataMngr.Posting.cs


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