本文整理汇总了C#中ExecutionContext.PutString方法的典型用法代码示例。如果您正苦于以下问题:C# ExecutionContext.PutString方法的具体用法?C# ExecutionContext.PutString怎么用?C# ExecutionContext.PutString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecutionContext
的用法示例。
在下文中一共展示了ExecutionContext.PutString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSaveExecutionContextJob2
public void TestSaveExecutionContextJob2()
{
var execution = new JobExecution(1);
var originalContext = new ExecutionContext();
execution.ExecutionContext = originalContext;
originalContext.PutString("test1", "test1");
originalContext.PutLong("test2", 2L);
_executionContextDao.SaveExecutionContext(execution);
var context = _executionContextDao.GetExecutionContext(execution);
Assert.AreEqual(originalContext, context);
}
示例2: TestSaveExecutionContextStep2
public void TestSaveExecutionContextStep2()
{
Insert(@"TestData\DbDao\ExecutionContextTestData.xml");
var jobExecution = new JobExecution(1);
var execution = new StepExecution("TestStep", jobExecution, 1);
var originalContext = new ExecutionContext();
execution.ExecutionContext = originalContext;
originalContext.PutString("test1", "test1");
originalContext.PutLong("test2", 2L);
_executionContextDao.SaveExecutionContext(execution);
var context = _executionContextDao.GetExecutionContext(execution);
Assert.AreEqual(originalContext, context);
}
示例3: Partition
/// <summary>
/// Creates one partition per resource and adds the URI in the context.
/// </summary>
/// <param name="gridSize">ignored</param>
/// <returns>a dictionary containing an execution context per resource</returns>
public IDictionary<string, ExecutionContext> Partition(int gridSize)
{
var contexts = new Dictionary<string, ExecutionContext>();
for (var i = 0; i < Resources.Count; i++)
{
var resource = Resources[i];
var context = new ExecutionContext();
Assert.State(resource.Exists(), string.Format("Resource does not exist: {0}",resource));
context.PutString(KeyName, resource.GetUri().AbsoluteUri);
context.PutInt(PartitionIdName, i);
contexts[PartitionKey + i] = context;
}
return contexts;
}