public ShortCode SaveFile(string rawText, string fileName) { var file = _uploadService.Save(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(rawText), false), fileName); var imgCode = _index.AddFile(System.IO.Path.GetRelativePath(_uploadService.RootPath.FullName, file.FullName), fileName); _index.AddFile(imgCode); return(imgCode); }
public async Task <string> Handle(ModUploadRequest request, CancellationToken cancellationToken, RequestHandlerDelegate <string> next) { var result = await next(); if (!string.IsNullOrWhiteSpace(result)) { _index.AddFile(result, result); } return(result); }