当前位置: 首页>>代码示例>>C#>>正文


C# EndpointConfiguration.UniquelyIdentifyRunningInstance方法代码示例

本文整理汇总了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
 }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:11,代码来源:SpecifyingHostId.cs

示例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
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:14,代码来源:HostIdFixer.cs

示例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));
        }
开发者ID:Particular,项目名称:NServiceBus,代码行数:10,代码来源:HostInfoSettingsTests.cs

示例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);
        }
开发者ID:Particular,项目名称:NServiceBus,代码行数:10,代码来源:HostInfoSettingsTests.cs


注:本文中的EndpointConfiguration.UniquelyIdentifyRunningInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。