Class AddAttachmentDefinition
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
Implements
Inherited Members
Properties
FileName
File name, or null (a file attachment uses the file's name).
public IExpression? FileName { 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.