dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

Virtual File System #62

Closed dazinator closed 4 years ago

dazinator commented 5 years ago

This item tracks enhancements to allow you to:

  1. Configure multiple virtual file systems for a tenant - each with a given key. For example, you could configure a virtual file system for static files to be served to the browser, plus another for content files, to be used to read files on the server side only.

  2. Set the Environment.ContentRootFileProvider of WebRootFileProvider to a multi-tenant IFileProvider implementation which is able to dynamically switch to the current tenants virtual file system (with a given key - as configured in 1).

  3. Have a factory injected via DI anywhere you need it, to get access to a current tenants VFS with a given key: Just accept a constructor argument of type: Func<string, Task<ICabinet>> and then invoke that with the key for the file system you set up in 1) and await the result. The ICabinet provides an IFileProvider to the virtual filesystem for read only access, as well as a writeable interface for creating files etc.

dazinator commented 4 years ago

Done