當前位置: 首頁>>代碼示例>>C#>>正文


C# Guid.Where方法代碼示例

本文整理匯總了C#中System.Guid.Where方法的典型用法代碼示例。如果您正苦於以下問題:C# Guid.Where方法的具體用法?C# Guid.Where怎麽用?C# Guid.Where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Guid的用法示例。


在下文中一共展示了Guid.Where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateProject

        public string CreateProject(Project newProject, Guid[] team, string milestones, string noAssignTasks, bool notifyManager, bool notifyResponsibles)
        {
            if (ProjectSecurity.CanCreateProject())
            {
                if (newProject != null)
                {
                    Global.EngineFactory.GetProjectEngine().SaveOrUpdate(newProject, notifyManager);
                    Global.EngineFactory.GetProjectEngine().AddToTeam(newProject,Global.EngineFactory.GetParticipantEngine().GetByID(newProject.Responsible), true);

                    //add team
                    foreach (var participant in team.Where(participant => participant != Guid.Empty))
                    {
                        Global.EngineFactory.GetProjectEngine().AddToTeam(newProject, Global.EngineFactory.GetParticipantEngine().GetByID(participant), true);
                    }

                    // add milestone
                    var listMilestones = MilestoneParser(milestones);

                    foreach (var milestone in listMilestones)
                    {
                        var milestoneTasks = TaskParser(milestone.Description);
                        milestone.Description = string.Empty;
                        milestone.Project = newProject;
                        Global.EngineFactory.GetMilestoneEngine().SaveOrUpdate(milestone, notifyResponsibles);

                        foreach (var task in milestoneTasks)
                        {
                            task.Status = TaskStatus.Open;
                            task.Milestone = milestone.ID;
                            task.Project = newProject;
                            Global.EngineFactory.GetTaskEngine().SaveOrUpdate(task, null, notifyResponsibles);
                        }
                    }

                    //add no assign tasks
                    
                    var listTasks = TaskParser(noAssignTasks);

                    foreach (var task in listTasks)
                    {
                        task.Project = newProject;
                        task.Status = TaskStatus.Open;
                        Global.EngineFactory.GetTaskEngine().SaveOrUpdate(task, null, notifyResponsibles);
                    }

                    return "?prjID=" + newProject.ID;
                }

            }

            return string.Empty;
        }
開發者ID:ridhouan,項目名稱:teamlab.v6.5,代碼行數:52,代碼來源:CreateProjectFromTemplate.aspx.cs

示例2: RemoveSourceCCAppId

 Guid[] RemoveSourceCCAppId(Guid[] allIds, ICommand command)
 {
     if (command.CommandGeneratedByCostCentreApplicationId == Guid.Empty)
         return allIds;
     return allIds
         .Where(n => n != command.CommandGeneratedByCostCentreApplicationId)
         .Distinct()
         .ToArray();
 }
開發者ID:asanyaga,項目名稱:BuildTest,代碼行數:9,代碼來源:CommandRoutingResolver.cs

示例3: ValidateOutput

 public void ValidateOutput(string[] cprNumbers, Guid?[] objectIds)
 {
     Assert.IsNotNull(objectIds, "Return value is null");
     Assert.AreEqual(cprNumbers.Length, objectIds.Length, "Return value length does not equal input length");
     foreach (var uuid in objectIds)
     {
         Assert.AreNotEqual(Guid.Empty, uuid, "UUID is empty");
         Assert.AreEqual(1, objectIds.Where((id) => id == uuid).Count(), "Repeated UUID : " + uuid.ToString());
     }
 }
開發者ID:magenta-aps,項目名稱:personmaster,代碼行數:10,代碼來源:Tests.cs


注:本文中的System.Guid.Where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。