Path: redb-route/redb.Route/Abstractions/IMessageAttachments.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Abstractions/IMessageAttachments.cs
----
namespace redb.Route.Abstractions;
///
/// The attachments of one message, in order. Unlike Camel's map, names may repeat: a form posts several files under one
/// field and two files may share a name, and a map would lose all but one. Lookups by name return the first match.
/// Names compare ordinally (file names and Content-IDs are case-sensitive).
///
/// Not thread-safe, like .
public interface IMessageAttachments : IReadOnlyList
{
/// The first attachment named , or null.
Attachment? Find(string name);
/// Every attachment named , in order; empty when there is none.
IReadOnlyList FindAll(string name);
/// Appends an attachment; an attachment with the same name may already be there.
void Add(Attachment attachment);
///
/// Puts in place of every attachment with its name: at the position of the first one,
/// or at the end when there is none.
///
void Set(Attachment attachment);
/// Removes every attachment named .
/// How many were removed.
int Remove(string name);
/// Removes all attachments.
void Clear();
}