Class InMemoryTemporaryFileStorage
Represents an in memory ITemporaryFileStorage implementation.
public class InMemoryTemporaryFileStorage : ITemporaryFileStorage
- Inheritance
-
InMemoryTemporaryFileStorage
- Implements
- Inherited Members
Constructors
InMemoryTemporaryFileStorage(IInMemoryTemporaryFileCache, IUserInfoAccessor)
Initializes a new instance of the InMemoryTemporaryFileStorage class.
public InMemoryTemporaryFileStorage(IInMemoryTemporaryFileCache cache, IUserInfoAccessor userInfoAccessor)
Parameters
cache
IInMemoryTemporaryFileCacheTemporary file cache.
userInfoAccessor
IUserInfoAccessorUser info accessor.
InMemoryTemporaryFileStorage(IUserInfoAccessor)
Initializes a new instance of the InMemoryTemporaryFileStorage class.
public InMemoryTemporaryFileStorage(IUserInfoAccessor userInfoAccessor)
Parameters
userInfoAccessor
IUserInfoAccessorUser info accessor.
Methods
AddAsync(BinaryFile)
Adds a file to the temporary storage.
public Task<Guid> AddAsync(BinaryFile file)
Parameters
file
BinaryFileThe File.
Returns
DeleteAsync(Guid)
Deletes a file in the temporary storage.
public Task DeleteAsync(Guid guid)
Parameters
guid
GuidThe file identifier.
Returns
ExistsAsync(Guid)
Gets a value indicating whether the file exists or not.
public Task<bool> ExistsAsync(Guid guid)
Parameters
guid
GuidThe file identifier.
Returns
FindAsync(Guid)
Finds a file in the temporary storage.
public Task<BinaryFile?> FindAsync(Guid guid)
Parameters
guid
GuidThe file identifier.
Returns
- Task<BinaryFile>
The file or null.
GetAsync(Guid)
Gets a file from the temporary storage.
public Task<BinaryFile> GetAsync(Guid guid)
Parameters
guid
GuidThe file identifier.
Returns
- Task<BinaryFile>
The file.
GetListAsync(Expression<Func<BinaryFile, bool>>?, Expression<Func<string?, bool>>?, bool)
Gets files from the temporary storage.
public Task<IList<BinaryFile>> GetListAsync(Expression<Func<BinaryFile, bool>>? filePredicate = null, Expression<Func<string?, bool>>? userIdPredicate = null, bool loadContent = false)
Parameters
filePredicate
Expression<Func<BinaryFile, bool>>File predicate.
userIdPredicate
Expression<Func<string, bool>>User id predicate.
loadContent
boolA value indicating whether the content should be loaded or not.
Returns
- Task<IList<BinaryFile>>
The files.