本文整理汇总了C#中System.Action.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# Action.Apply方法的具体用法?C# Action.Apply怎么用?C# Action.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Action
的用法示例。
在下文中一共展示了Action.Apply方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
public static JobExecution Build(Action<JobExecutionFactoryContext> with)
{
return with.Apply(context =>
{
return new JobExecution
{
Identifier = context.Entry.Identifier,
Deploy = Deploy(context),
NextRun = NextRun(context),
Job = context.Entry.Job,
Progress = new JobExecutionProgress
{
GetStatus = GetStatus(context),
OnScheduled = OnScheduled(context),
OnStarted = OnStarted(context),
OnCompleted = OnCompleted(context),
OnFailed = OnFailed(context),
GetPid = GetPid(context)
},
Metrics = new JobExecutionMetrics
{
OnMemory = OnMemory(context),
OnProcessor = OnProcessor(context)
}
};
});
}
示例2: Create
public static BlobRepository Create(Action<BlobRepositoryFactoryContext> with)
{
return with.Apply(context =>
{
return new BlobRepository
{
GetById = GetById(context),
New = New(context)
};
});
}
示例3: Create
public static JobTaskRepository Create(Action<JobTaskRepositoryFactoryContext> with)
{
return with.Apply(context =>
{
return new JobTaskRepository
{
New = New(context),
GetByJob = GetByJob(context)
};
});
}
示例4: Create
public static JobRepository Create(Action<JobRepositoryFactoryContext> with)
{
return with.Apply(context =>
{
return new JobRepository
{
New = New(context),
All = All(context),
Single = Single(context),
Update = Update(context)
};
});
}
示例5: Create
public static Blob Create(Action<BlobFactoryContext> with)
{
return with.Apply(context =>
{
return new Blob
{
Identifier = context.Identifier,
GetHash = GetHash(context),
GetSize = GetSize(context),
GetFiles = GetFiles(context),
DeployTo = DeployTo(context)
};
});
}
示例6: Build
public static JobTask Build(Action<JobTaskFactoryContext> with)
{
return with.Apply(context =>
{
return new JobTask
{
Identifier = context.Execution.Identifier,
Start = Start(context),
Statistics = new JobTaskStatistics
{
Publish = PublishStatistics(context)
}
};
});
}