Class AddAttachmentDefinition

Assembly: redb.Route.dll

Leaf definition that adds an attachment to the In message. The name and the content type are literal; the file
name and the file path are literal or an expression, chosen by the overload (never guessed from the text).

public sealed class AddAttachmentDefinition : ProcessorDefinition, IProcessorDefinition

Inheritance

Object→ProcessorDefinition→AddAttachmentDefinition

Implements

Inherited Members

Properties

Content

Content () or file path ().

public IExpression? Content { get; }

ContentType

Content type, or null for the default of the source.

public string? ContentType { get; }

FileName

File name, or null (a file attachment uses the file's name).

public IExpression? FileName { get; }

Name

The attachment name; for a file it may be null, the file name then.

public string? Name { get; }

Source

The content source.

public AttachmentSource Source { get; }

Methods

CreateProcessor(IRouteContext)

Compile this node into a runtime processor.

public override IProcessor CreateProcessor(IRouteContext context)

FromBody(string, IExpression?, string?)

An attachment with the message body as content.

public static AddAttachmentDefinition FromBody(string name, IExpression? fileName = null, string? contentType = null)

FromExpression(string, IExpression, IExpression?, string?)

An attachment with the value of content.

public static AddAttachmentDefinition FromExpression(string name, IExpression content, IExpression? fileName = null, string? contentType = null)

FromFile(IExpression, string?, string?)

An attachment with the content of the file at path.

public static AddAttachmentDefinition FromFile(IExpression path, string? name = null, string? contentType = null)

Remarks

Content of an expression or the body: byte[] as is, string as UTF-8, a completed
shared (re-readable), another read into memory, an
as is. A file is not read here: the attachment opens it on every read.