Interface ITemporaryFileStorage
Provides the functionalities to store temporary files.
public interface ITemporaryFileStorage
Methods
AddAsync(BinaryFile)
Adds a file to the temporary storage.
Task<Guid> AddAsync(BinaryFile file)
Parameters
fileBinaryFileThe File.
Returns
AddAsync(BinaryFile, CancellationToken)
Adds a file to the temporary storage.
Task<Guid> AddAsync(BinaryFile file, CancellationToken cancellationToken)
Parameters
fileBinaryFileThe File.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
DeleteAsync(Guid)
Deletes a file in the temporary storage.
Task DeleteAsync(Guid guid)
Parameters
guidGuidThe file identifier.
Returns
DeleteAsync(Guid, CancellationToken)
Deletes a file in the temporary storage.
Task DeleteAsync(Guid guid, CancellationToken cancellationToken)
Parameters
guidGuidThe file identifier.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
DeleteAsync(Guid[], CancellationToken)
Deletes files in the temporary storage.
Task DeleteAsync(Guid[] guids, CancellationToken cancellationToken)
Parameters
guidsGuid[]The file identifiers.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
ExistsAsync(Guid)
Gets a value indicating whether the file exists or not.
Task<bool> ExistsAsync(Guid guid)
Parameters
guidGuidThe file identifier.
Returns
ExistsAsync(Guid, CancellationToken)
Gets a value indicating whether the file exists or not.
Task<bool> ExistsAsync(Guid guid, CancellationToken cancellationToken)
Parameters
guidGuidThe file identifier.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
FindAsync(Guid)
Finds a file in the temporary storage.
Task<BinaryFile?> FindAsync(Guid guid)
Parameters
guidGuidThe file identifier.
Returns
- Task<BinaryFile>
The file or null.
FindAsync(Guid, CancellationToken)
Finds a file in the temporary storage.
Task<BinaryFile?> FindAsync(Guid guid, CancellationToken cancellationToken)
Parameters
guidGuidThe file identifier.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<BinaryFile>
The file or null.
GetAsync(Guid)
Gets a file from the temporary storage.
Task<BinaryFile> GetAsync(Guid guid)
Parameters
guidGuidThe file identifier.
Returns
- Task<BinaryFile>
The file.
GetAsync(Guid, CancellationToken)
Gets a file from the temporary storage.
Task<BinaryFile> GetAsync(Guid guid, CancellationToken cancellationToken)
Parameters
guidGuidThe file identifier.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<BinaryFile>
The file.
GetListAsync(Expression<Func<BinaryFile, bool>>?, Expression<Func<string?, bool>>?, bool)
Gets files from the temporary storage.
Task<IList<BinaryFile>> GetListAsync(Expression<Func<BinaryFile, bool>>? filePredicate = null, Expression<Func<string?, bool>>? userIdPredicate = null, bool loadContent = false)
Parameters
filePredicateExpression<Func<BinaryFile, bool>>File predicate.
userIdPredicateExpression<Func<string, bool>>User id predicate.
loadContentboolA value indicating whether the content should be loaded or not.
Returns
- Task<IList<BinaryFile>>
The files.
GetListAsync(Expression<Func<BinaryFile, bool>>?, Expression<Func<string?, bool>>?, bool, CancellationToken)
Gets files from the temporary storage.
Task<IList<BinaryFile>> GetListAsync(Expression<Func<BinaryFile, bool>>? filePredicate, Expression<Func<string?, bool>>? userIdPredicate, bool loadContent, CancellationToken cancellationToken)
Parameters
filePredicateExpression<Func<BinaryFile, bool>>File predicate.
userIdPredicateExpression<Func<string, bool>>User id predicate.
loadContentboolA value indicating whether the content should be loaded or not.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<IList<BinaryFile>>
The files.