Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 21, 2024 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/33f6e2c52786087df6e59a3766fcd518 to your computer and use it in GitHub Desktop.
Save bjoerntx/33f6e2c52786087df6e59a3766fcd518 to your computer and use it in GitHub Desktop.
[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