-
-
Save eskye/68a5af47ae5e55edd85ec9bbe6149d39 to your computer and use it in GitHub Desktop.
GetFlureeSnapshot file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<FileObject> GetFlureeSnapshot() | |
{ | |
var result = await CreateSnapshot("local/firstdb"); | |
var files = Directory.GetFiles( @"\flureedb\data\ledger\local\testmydb\snapshot"); | |
var file = files.FirstOrDefault(x => x.Contains(result)) ?? throw new Exception($"File does not exist"); | |
var fileByte = await File.ReadAllBytesAsync(file); | |
var fileInfo = new FileInfo(file); | |
return new FileObject | |
{ | |
File = fileByte, | |
FileName = fileInfo.Name | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment