static AttachmentSettings SetAttachments(EndpointConfiguration configuration, SettingsHolder settings, AttachmentSettings attachments) { settings.Set(attachments); configuration.EnableFeature <AttachmentFeature>(); configuration.DisableFeature <AttachmentsUsedWhenNotEnabledFeature>(); return(attachments); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, string fileShare, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNullOrEmpty(fileShare, nameof(fileShare)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(fileShare, timeToKeep); settings.Set(attachments); configuration.EnableFeature <AttachmentFeature>(); configuration.DisableFeature <AttachmentsUsedWhenNotEnabledFeature>(); return(attachments); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, Func <Task <SqlConnection> > connectionFactory, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNull(connectionFactory, nameof(connectionFactory)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(connectionFactory, timeToKeep); settings.Set <AttachmentSettings>(attachments); configuration.EnableFeature <AttachmentFeature>(); configuration.DisableFeature <AttachmentsUsedWhenNotEnabledFeature>(); return(attachments); }
public static void TweakConfigurationBuilder(IConfigureThisEndpoint specifier, EndpointConfiguration config) { // ReSharper disable once SuspiciousTypeConversion.Global if (specifier is AsA_Client) { config.PurgeOnStartup(true); config.GetSettings().Set <TransportTransactionMode>(TransportTransactionMode.None); config.Recoverability().Delayed(delayed => delayed.NumberOfRetries(0)); config.DisableFeature <TimeoutManager>(); } Type transportDefinitionType; if (TryGetTransportDefinitionType(specifier, out transportDefinitionType)) { config.UseTransport(transportDefinitionType); } }
/// <summary> /// Disables the given feature. /// </summary> /// <param name="config">The <see cref="EndpointConfiguration" /> instance to apply the settings to.</param> public static void DisableFeature <T>(this EndpointConfiguration config) where T : Feature { Guard.AgainstNull(nameof(config), config); config.DisableFeature(typeof(T)); }