Interface IIconStore
Pluggable storage for icon bytes. The built-in default (MongoIconStore in
Tharga.Team.MongoDB) stores icons in the database; a consuming system can replace it via
o.AddIconStore<T>() to store elsewhere (Azure Blob, S3, an existing DMS, …). This is the
storage seam — where bytes live; where a displayed image is sourced from is the separate
IIconSource seam.
public interface IIconStore
Methods
DeleteAsync(string, CancellationToken)
Delete an icon by reference. A missing reference is a no-op.
Task DeleteAsync(string reference, CancellationToken cancellationToken = default)
Parameters
referencestringcancellationTokenCancellationToken
Returns
LoadAsync(string, CancellationToken)
Load an icon by the reference returned from SaveAsync(IconKind, string, byte[], string, CancellationToken); null when it does not exist.
Task<IconContent> LoadAsync(string reference, CancellationToken cancellationToken = default)
Parameters
referencestringcancellationTokenCancellationToken
Returns
SaveAsync(IconKind, string, byte[], string, CancellationToken)
Persist an icon and return an opaque reference to it (an id or URL) for later load/delete
and for storing on the owning team/user record.
Task<string> SaveAsync(IconKind kind, string ownerKey, byte[] data, string contentType, CancellationToken cancellationToken = default)
Parameters
kindIconKindownerKeystringdatabyte[]contentTypestringcancellationTokenCancellationToken