本文整理汇总了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
}
示例2: Usage
public Usage()
{
#region DefiningEncryptedPropertiesAs
EndpointConfiguration configuration = new EndpointConfiguration();
ConventionsBuilder conventions = configuration.Conventions();
conventions.DefiningEncryptedPropertiesAs(info => info.Name.EndsWith("EncryptedProperty"));
#endregion
}
示例3: DefineExpress
DefineExpress(EndpointConfiguration endpointConfiguration)
{
#region ExpressMessageConvention
var conventionsBuilder = endpointConfiguration.Conventions();
conventionsBuilder.DefiningExpressMessagesAs(t => t.Name.EndsWith("Express"));
#endregion
}
示例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
}
示例5: Usage
Usage(EndpointConfiguration endpointConfiguration)
{
#region DefineMessageWithLargePayloadUsingConvention
ConventionsBuilder conventions = endpointConfiguration.Conventions();
conventions.DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus"));
#endregion
}
示例6: DefineExpress
public DefineExpress()
{
#region ExpressMessageConvention
EndpointConfiguration configuration = new EndpointConfiguration();
ConventionsBuilder builder = configuration.Conventions();
builder.DefiningExpressMessagesAs(t => t.Name.EndsWith("Express"));
#endregion
}
示例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
}
示例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
}
示例9: DiscardingOldMessages
DiscardingOldMessages(EndpointConfiguration endpointConfiguration)
{
#region DiscardingOldMessagesWithCode
endpointConfiguration.Conventions()
.DefiningTimeToBeReceivedAs(type =>
{
if (type == typeof (MyMessage))
{
return TimeSpan.FromHours(1);
}
return TimeSpan.MaxValue;
});
#endregion
}
示例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
}
示例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
}
示例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();
}