本文整理汇总了C#中EndpointConfiguration.UniquelyIdentifyRunningInstance方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.UniquelyIdentifyRunningInstance方法的具体用法?C# EndpointConfiguration.UniquelyIdentifyRunningInstance怎么用?C# EndpointConfiguration.UniquelyIdentifyRunningInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndpointConfiguration
的用法示例。
在下文中一共展示了EndpointConfiguration.UniquelyIdentifyRunningInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpecifyingHostId
SpecifyingHostId(EndpointConfiguration endpointConfiguration)
{
#region 5to6-Specifying-HostId-Using-Api
endpointConfiguration.UniquelyIdentifyRunningInstance()
.UsingNames("endpointName", Environment.MachineName);
// or
Guid hostId = CreateMyUniqueIdThatIsTheSameAcrossRestarts();
endpointConfiguration.UniquelyIdentifyRunningInstance()
.UsingCustomIdentifier(hostId);
#endregion
}
示例2: Start
public void Start()
{
#region HostIdFixer
EndpointConfiguration configuration = new EndpointConfiguration();
configuration.UniquelyIdentifyRunningInstance()
.UsingNames("endpointName", Environment.MachineName);
// or
Guid hostId = CreateMyUniqueIdThatIsTheSameAcrossRestarts();
configuration.UniquelyIdentifyRunningInstance()
.UsingCustomIdentifier(hostId);
#endregion
}
示例3: It_allows_to_generate_a_deterministic_id_using_instance_and_host_names
public void It_allows_to_generate_a_deterministic_id_using_instance_and_host_names()
{
var busConfig = new EndpointConfiguration("myendpoint");
Assert.IsFalse(busConfig.Settings.HasSetting(HostInformationFeature.HostIdSettingsKey));
busConfig.UniquelyIdentifyRunningInstance().UsingNames("Instance","Host");
Assert.IsTrue(busConfig.Settings.HasExplicitValue(HostInformationFeature.HostIdSettingsKey));
}
示例4: It_overrides_the_host_id
public void It_overrides_the_host_id()
{
var requestedId = Guid.NewGuid();
var busConfig = new EndpointConfiguration("myendpoint");
busConfig.UniquelyIdentifyRunningInstance().UsingCustomIdentifier(requestedId);
var configuredId = busConfig.Settings.Get<Guid>(HostInformationFeature.HostIdSettingsKey);
Assert.AreEqual(requestedId, configuredId);
}