You will want to implement your own classes IFileSystemand IFileInfo. An example of this can be seen in the dev branch on CodePlex in the section src/Microsoft.Owin.FileSystems/EmbeddedResourceFileSystem.cs. It was a community contribution based on this project .
After implementation, you will use it like this
public class InMemoryFileSystem : IFileSystem
{
public InMemoryFileSystem(IDictionary<string, object> files)
{}
}
var files = LoadFilesIntoDictionary();
app.UseStaticFiles(options => {
options.WithFileSystem(new InMemoryFileSystem(files));
});
source
share