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


C# EndpointConfiguration.Conventions方法代码示例

本文整理汇总了C#中EndpointConfiguration.Conventions方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointConfiguration.Conventions方法的具体用法?C# EndpointConfiguration.Conventions怎么用?C# EndpointConfiguration.Conventions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EndpointConfiguration的用法示例。


在下文中一共展示了EndpointConfiguration.Conventions方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Usage

 Usage(EndpointConfiguration endpointConfiguration)
 {
     #region DefiningEncryptedPropertiesAs
     ConventionsBuilder conventions = endpointConfiguration.Conventions();
     conventions.DefiningEncryptedPropertiesAs(info => info.Name.EndsWith("EncryptedProperty"));
     #endregion
 }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:7,代码来源:Usage.cs

示例2: Usage

 public Usage()
 {
     #region DefiningEncryptedPropertiesAs
     EndpointConfiguration configuration = new EndpointConfiguration();
     ConventionsBuilder conventions = configuration.Conventions();
     conventions.DefiningEncryptedPropertiesAs(info => info.Name.EndsWith("EncryptedProperty"));
     #endregion
 }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:8,代码来源:Usage.cs

示例3: DefineExpress

        DefineExpress(EndpointConfiguration endpointConfiguration)
        {
            #region ExpressMessageConvention
            var conventionsBuilder = endpointConfiguration.Conventions();
            conventionsBuilder.DefiningExpressMessagesAs(t => t.Name.EndsWith("Express"));

            #endregion
        }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:8,代码来源:DefineExpress.cs

示例4: Usage

        public Usage()
        {
            #region DefiningEventsAs

            EndpointConfiguration configuration = new EndpointConfiguration();
            ConventionsBuilder conventions = configuration.Conventions();
            conventions.DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("Domain") && t.Name.EndsWith("Event"));
            #endregion
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:9,代码来源:Usage.cs

示例5: Usage

        Usage(EndpointConfiguration endpointConfiguration)
        {
            #region DefineMessageWithLargePayloadUsingConvention

            ConventionsBuilder conventions = endpointConfiguration.Conventions();
            conventions.DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus"));

            #endregion

        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:10,代码来源:Usage.cs

示例6: DefineExpress

        public DefineExpress()
        {
            #region ExpressMessageConvention

            EndpointConfiguration configuration = new EndpointConfiguration();
            ConventionsBuilder builder = configuration.Conventions();
            builder.DefiningExpressMessagesAs(t => t.Name.EndsWith("Express"));

            #endregion
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:10,代码来源:DefineExpress.cs

示例7: ServiceControlEventsConfig

        ServiceControlEventsConfig(EndpointConfiguration endpointConfiguration)
        {
            #region ServiceControlEventsConfig 

            // required to talk to ServiceControl
            endpointConfiguration.UseSerialization<JsonSerializer>();
            endpointConfiguration.Conventions()
                .DefiningEventsAs(t => typeof(IEvent).IsAssignableFrom(t) ||
                                       //include ServiceControl events
                                       t.Namespace != null &&
                                       t.Namespace.StartsWith("ServiceControl.Contracts"));

            #endregion
        }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:14,代码来源:ServiceControlEventsConfig.cs

示例8: Usage

        Usage(EndpointConfiguration endpointConfiguration)
        {
            #region MessageConventions
            ConventionsBuilder conventions = endpointConfiguration.Conventions();
            conventions.DefiningCommandsAs(t => t.Namespace == "MyNamespace.Messages.Commands");
            conventions.DefiningEventsAs(t => t.Namespace == "MyNamespace.Messages.Events");
            conventions.DefiningMessagesAs(t => t.Namespace == "MyNamespace.Messages");
            conventions.DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted"));
            conventions.DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus"));
            conventions.DefiningExpressMessagesAs(t => t.Name.EndsWith("Express"));
            conventions.DefiningTimeToBeReceivedAs(t =>
                t.Name.EndsWith("Expires") ? TimeSpan.FromSeconds(30) : TimeSpan.MaxValue);

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:15,代码来源:Usage.cs

示例9: DiscardingOldMessages

        DiscardingOldMessages(EndpointConfiguration endpointConfiguration)
        {
            #region DiscardingOldMessagesWithCode
            endpointConfiguration.Conventions()
                .DefiningTimeToBeReceivedAs(type =>
                {
                    if (type == typeof (MyMessage))
                    {
                        return TimeSpan.FromHours(1);
                    }
                    return TimeSpan.MaxValue;
                });

            #endregion
        }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:15,代码来源:DiscardingOldMessages.cs

示例10: Simple

        public void Simple()
        {
            EndpointConfiguration configuration = new EndpointConfiguration();

            #region ServiceControlEventsConfig 

            // required to talk to ServiceControl
            configuration.UseLegacyMessageDrivenSubscriptionMode();
            configuration.UseSerialization<JsonSerializer>();
            configuration.Conventions()
                .DefiningEventsAs(t => typeof(IEvent).IsAssignableFrom(t) ||
                                       //include ServiceControl events
                                       t.Namespace != null && t.Namespace.StartsWith("ServiceControl.Contracts"));

            #endregion
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:16,代码来源:ServiceControlEventsConfig.cs

示例11: Simple

        public void Simple()
        {
            #region DiscardingOldMessagesWithCode

            EndpointConfiguration configuration = new EndpointConfiguration();

            configuration.Conventions()
                .DefiningTimeToBeReceivedAs(type =>
                {
                    if (type == typeof (MyMessage))
                    {
                        return TimeSpan.FromHours(1);
                    }
                    return TimeSpan.MaxValue;
                });

            #endregion
        }
开发者ID:fivec,项目名称:docs.particular.net,代码行数:18,代码来源:DiscardingOldMessages.cs

示例12: Main

    static void Main()
    {
        var endpointConfiguration = new EndpointConfiguration("Samples.Scaleout.Worker");
        endpointConfiguration.ScaleOut()
            .InstanceDiscriminator(ConfigurationManager.AppSettings["InstanceId"]);
        endpointConfiguration
            .EnlistWithLegacyMSMQDistributor(
            ConfigurationManager.AppSettings["DistributorAddress"],
            ConfigurationManager.AppSettings["DistributorControlAddress"],
            10);
        endpointConfiguration.UseSerialization<JsonSerializer>();
        endpointConfiguration.UsePersistence<InMemoryPersistence>();
        endpointConfiguration.SendFailedMessagesTo("error");
        endpointConfiguration.EnableInstallers();
        endpointConfiguration.Conventions()
            .DefiningMessagesAs(t => t.GetInterfaces().Contains(typeof(IMessage)));

        Run(endpointConfiguration).GetAwaiter().GetResult();
    }
开发者ID:chriscatilo,项目名称:docs.particular.net,代码行数:19,代码来源:Program.cs


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