Interface IAttachmentPlugin
Interface for plugins that handle Service Attachments; more specifically, fetching/saving the actual attachment content and related methods like Delete and existence checks.
Namespace: SuperOffice.CRM.Attachment
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public interface IAttachmentPlugin
Methods
AttachmentExistsAsync(CancellationToken)
Check if an attachment content exists
Declaration
Task<bool> AttachmentExistsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | true if content exists |
DeleteAsync()
Method to remove an attachment
Declaration
Task DeleteAsync()
Returns
Type | Description |
---|---|
Task |
Remarks
Port from Attachment::remove
GetDataAsync(CancellationToken)
Get the content of the attachment
Declaration
Task<Stream> GetDataAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Stream> | Stream of data |
SaveDataAsync(Stream)
Save the content of the attachment
Declaration
Task SaveDataAsync(Stream data)
Parameters
Type | Name | Description |
---|---|---|
Stream | data | Attachment data |
Returns
Type | Description |
---|---|
Task | Content length in bytes |
SetAttachmentIdAsync(int, CancellationToken)
Interface for plugins that handle Service Attachments; more specifically, fetching/saving the actual attachment content and related methods like Delete and existence checks.
Declaration
Task SetAttachmentIdAsync(int attachmentId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | attachmentId | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |