public static async Task <T> GetJsonObject <T>(this IFileStoreService fileStoreService, string bucketName, string fileKey) { using (var stream = await fileStoreService.GetStream(bucketName, fileKey)) { return(await JsonSerializer.DeserializeAsync <T>(stream)); } }
public FileRetrievalService( IFileStoreService fileStoreService, IAmazonS3 s3Client) { _fileStoreService = fileStoreService; _s3Client = s3Client; }
public static async Task PutLocalFile(this IFileStoreService fileStoreService, string bucketName, string fileKey, string localFilePath) { using (var fileStream = new FileStream(localFilePath, FileMode.Open)) { await fileStoreService.PutStream(bucketName, fileKey, fileStream); } }
public SimpleResizedImageAssetFileService( IFileStoreService fileService, IQueryExecutor queryExecutor ) { _fileService = fileService; _queryExecutor = queryExecutor; }
public GetImageAssetFileByIdQueryHandler( IFileStoreService fileStoreService, IQueryExecutor queryExecutor ) { _fileStoreService = fileStoreService; _queryExecutor = queryExecutor; }
public static async Task PutContent(this IFileStoreService fileStoreService, string bucketName, string fileKey, string content) { using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(content ?? string.Empty))) { stream.Seek(0, SeekOrigin.Begin); await fileStoreService.PutStream(bucketName, fileKey, stream); } }
public GetDocumentAssetFileByIdQueryHandler( IFileStoreService fileStoreService, CofoundryDbContext dbContext ) { _fileStoreService = fileStoreService; _dbContext = dbContext; }
public GetImageAssetFileByIdQueryHandler( IFileStoreService fileStoreService, IQueryExecutor queryExecutor, IImageAssetFileMapper imageAssetFileMapper ) { _fileStoreService = fileStoreService; _queryExecutor = queryExecutor; _imageAssetFileMapper = imageAssetFileMapper; }
public static async Task SaveToLocalFile(this IFileStoreService fileStoreService, string bucketName, string fileKey, string localFilePath) { using (var fileStream = new FileStream(localFilePath, FileMode.CreateNew)) { using (var stream = await fileStoreService.GetStream(bucketName, fileKey)) { await stream.CopyToAsync(fileStream); } } }
public static async Task <string> GetContent(this IFileStoreService fileStoreService, string bucketName, string fileKey) { using (var stream = await fileStoreService.GetStream(bucketName, fileKey)) { using (var reader = new StreamReader(stream, Encoding.UTF8)) { return(await reader.ReadToEndAsync()); } } }
public static async Task PutJsonObject <T>(this IFileStoreService fileStoreService, string bucketName, string fileKey, T objectToStore) { using (var stream = new MemoryStream()) { await JsonSerializer.SerializeAsync(stream, objectToStore); stream.Seek(0, SeekOrigin.Begin); await fileStoreService.PutStream(bucketName, fileKey, stream); } }
public MockImageAssetFileService( CofoundryDbContext dbContext, IFileStoreService fileStoreService, ITransactionScopeManager transactionScopeManager ) { _dbContext = dbContext; _fileStoreService = fileStoreService; _transactionScopeManager = transactionScopeManager; }
public DocumentAssetCommandHelper( CofoundryDbContext dbContext, IFileStoreService fileStoreService, ITransactionScopeManager transactionScopeFactory ) { _dbContext = dbContext; _fileStoreService = fileStoreService; _transactionScopeFactory = transactionScopeFactory; }
public DocumentController( IDocumentService documentService, IFileStoreService fileStoreService, AppIdentity appIdentity, IMapper mapper) { _documentService = documentService; _fileStoreService = fileStoreService; _mapper = mapper; _appIdentity = appIdentity; }
public ImageSharpImageAssetFileService( CofoundryDbContext dbContext, IFileStoreService fileStoreService, ITransactionScopeManager transactionScopeManager, ImageAssetsSettings imageAssetsSettings ) { _dbContext = dbContext; _fileStoreService = fileStoreService; _transactionScopeManager = transactionScopeManager; _imageAssetsSettings = imageAssetsSettings; }
public ImageSharpResizedImageAssetFileService( IFileStoreService fileService, IQueryExecutor queryExecutor, ImageAssetsSettings imageAssetsSettings, ILogger <ImageSharpResizedImageAssetFileService> logger ) { _fileService = fileService; _queryExecutor = queryExecutor; _logger = logger; _imageAssetsSettings = imageAssetsSettings; }
public DeleteDocumentAssetCommandHandler( CofoundryDbContext dbContext, ICommandExecutor commandExecutor, ITransactionScopeManager transactionScopeFactory, IMessageAggregator messageAggregator, IFileStoreService fileStoreService ) { _dbContext = dbContext; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; _messageAggregator = messageAggregator; _fileStoreService = fileStoreService; }
public DocumentAssetCommandHelper( CofoundryDbContext dbContext, IFileStoreService fileStoreService, ITransactionScopeManager transactionScopeFactory, IMimeTypeService mimeTypeService, IAssetFileTypeValidator assetFileTypeValidator ) { _dbContext = dbContext; _fileStoreService = fileStoreService; _transactionScopeFactory = transactionScopeFactory; _mimeTypeService = mimeTypeService; _assetFileTypeValidator = assetFileTypeValidator; }
public CleanUpAssetFilesCommandHandler( IDistributedLockManager distributedLockManager, CofoundryDbContext dbContext, IFileStoreService fileStoreService, IResizedImageAssetFileService resizedImageAssetFileService, AssetFileCleanupSettings assetFileCleanupSettings, ILogger <CleanUpAssetFilesCommandHandler> logger ) { _distributedLockManager = distributedLockManager; _dbContext = dbContext; _fileStoreService = fileStoreService; _resizedImageAssetFileService = resizedImageAssetFileService; _assetFileCleanupSettings = assetFileCleanupSettings; _logger = logger; }
public AlbumControllerTests() { _albums = new List<Album>(); for (int i = 1; i <= 5; i++) { var album = new Album() { ID = i }; _albums.Add(album); } var mockFileStoreService = new Mock<IFileStoreService>(); _fileStoreService = mockFileStoreService.Object; }
public DeleteImageAssetCommandHandler( CofoundryDbContext dbContext, IImageAssetCache imageAssetCache, ICommandExecutor commandExecutor, ITransactionScopeManager transactionScopeFactory, IMessageAggregator messageAggregator, IFileStoreService fileStoreService, IResizedImageAssetFileService resizedImageAssetFileService ) { _dbContext = dbContext; _imageAssetCache = imageAssetCache; _commandExecutor = commandExecutor; _transactionScopeFactory = transactionScopeFactory; _messageAggregator = messageAggregator; _fileStoreService = fileStoreService; _resizedImageAssetFileService = resizedImageAssetFileService; }
public DeleteFileHandler(IFileStoreService fileStoreService, IMapper mapper) { _fileStoreService = fileStoreService; _mapper = mapper; }
public AlbumController(IAlbumService albumService, IFileStoreService fileStoreService) { _albumService = albumService ?? new AlbumService(new AlbumRepository()); _fileStoreService = fileStoreService ?? new FileStoreService(); }
public DownloadFileHandler(IFileStoreService fileStoreService) { _fileStoreService = fileStoreService; }
public UploadFileHandler(IFileStoreService fileStoreService, IMapper mapper) { _fileStoreService = fileStoreService; _mapper = mapper; }