-
Notifications
You must be signed in to change notification settings - Fork 82
Suggest to make NotFoundFileInfo and NoopChangeToken public #145
Comments
Can you clarify the reason for wanting them public? Are you writing a custom file system provider? Or something else? |
Hi Eilon, I'm writing a ViewFileProvider, I hope this FileProvider can serve MVC by using view files saved in the database. I need to return NoopChangeToken and NotFoundFileInfo like what RazorEmbeddedFileProvider did. public IChangeToken Watch(string pattern)
{
return NoopChangeToken.Singleton;
} Thanks |
Ah, got it. So just for code re-use, which sounds fine. Just wanted to make sure it wasn't for checking equality, which would be wrong (e.g. checking |
thank you for reminding. I cloned the two classes into my namespace for now. if you decide to make the two classes public I should be able use them directly. Thanks again. |
Hi, |
@PrimeObjects all of these packages are in the |
@pranavkm I have tried to do this for my composite file provider, but the |
We don't publish any of the Sources packages to NuGet.org. You'd have to pick it up from |
I second this suggestion, my use case is a custom IFileProvider that internally wraps the PhysicalFileProvider to provide a virtual file system, returning files based on other criteria than just the file path. If all criteria fails to find the requested file, I would like to return NotFoundFileInfo directly. Returning null just yields a NullReferenceException in Microsoft.AspNet.StaticFiles.StaticFileContext.LookupFileInfo() |
I agree with this, I am using SaasKit and have a tenant context. My file provider takes that context into account and servers up files based on the tenant. I had to copy several classes into my code from the source, and that is a pretty ugly solution. Because of this, I get the impression that you guys don't want us making new file providers. Is that the correct? Am I missing something here? |
@Eilon - thoughts on publishing the NoOp* types from Sources into Abstractions? |
In 1.0.1. No time in this milestone. |
I understand you guys are all swamped at the moment to get to RTM, so would you accept a pull request with this change? |
@Driedas we would certainly consider it, though of course it's difficult to guarantee anything 😄 |
Assigning to @pranavkm because he's taking care of the PR. |
Fixed in f282bce |
No description provided.
The text was updated successfully, but these errors were encountered: