本文整理汇总了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;
}
示例2: RemoveSourceCCAppId
Guid[] RemoveSourceCCAppId(Guid[] allIds, ICommand command)
{
if (command.CommandGeneratedByCostCentreApplicationId == Guid.Empty)
return allIds;
return allIds
.Where(n => n != command.CommandGeneratedByCostCentreApplicationId)
.Distinct()
.ToArray();
}
示例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());
}
}