/// <summary> /// Use a specific <paramref name="tableName"/> and <paramref name="schema"/> for the attachments table. /// </summary> public void UseTableName(string tableName, string schema = "dbo") { Guard.AgainstNullOrEmpty(tableName, nameof(tableName)); Guard.AgainstNullOrEmpty(schema, nameof(schema)); TableName = tableName; Schema = schema; }
/// <summary> /// Configures string to use for <see cref="Headers.ContentType"/> headers. /// </summary> /// <remarks> /// Defaults to "wire". /// </remarks> /// <param name="config">The <see cref="SerializationExtensions{T}"/> instance.</param> /// <param name="contentTypeKey">The content type key to use.</param> public static void ContentTypeKey(this SerializationExtensions <MessagePack.MessagePackSerializer> config, string contentTypeKey) { Guard.AgainstNull(config, nameof(config)); Guard.AgainstNullOrEmpty(contentTypeKey, nameof(contentTypeKey)); var settings = config.GetSettings(); settings.Set("NServiceBus.MessagePack.ContentTypeKey", contentTypeKey); }
/// <summary> /// Enable SQL attachments for this endpoint. /// </summary> public static AttachmentSettings EnableAttachments( this EndpointConfiguration configuration, string connection, GetTimeToKeep timeToKeep) { Guard.AgainstNull(configuration, nameof(configuration)); Guard.AgainstNull(timeToKeep, nameof(timeToKeep)); Guard.AgainstNullOrEmpty(connection, nameof(connection)); var settings = configuration.GetSettings(); var attachments = new AttachmentSettings(() => OpenConnection(connection), timeToKeep); return(SetAttachments(configuration, settings, 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> /// Configures string to use for <see cref="Headers.ContentType"/> headers. /// </summary> /// <remarks> /// Defaults to <see cref="ContentTypes.Json"/>. /// This setting is required when this serializer needs to co-exist with other json serializers. /// </remarks> /// <param name="config">The <see cref="SerializationExtensions{T}"/> instance.</param> /// <param name="contentTypeKey">The content type key to use.</param> public static void ContentTypeKey(this SerializationExtensions <NewtonsoftSerializer> config, string contentTypeKey) { Guard.AgainstNull(config, nameof(config)); Guard.AgainstNullOrEmpty(contentTypeKey, nameof(contentTypeKey)); config.GetSettings().Set("NServiceBus.Newtonsoft.Json.ContentTypeKey", contentTypeKey); }