Created
March 21, 2024 13:22
-
-
Save bjoerntx/33f6e2c52786087df6e59a3766fcd518 to your computer and use it in GitHub Desktop.
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
[HttpGet] | |
[Route("List")] | |
public IEnumerable<DocumentData> List() | |
{ | |
// file all file names from App_Data | |
var files = Directory.GetFiles("App_Data"); | |
var data = new List<DocumentData>(); | |
foreach (var file in files) | |
{ | |
data.Add(new DocumentData | |
{ | |
Name = Path.GetFileName(file), | |
}); | |
} | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment