当前位置: 首页>>代码示例>>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;未经允许,请勿转载。