@@ -31,11 +31,11 @@ building upon `Microsoft.Extensions.FileProviders`.
3131
3232## Projects
3333
34- This repository contains projects:
34+ This repository contains the following projects:
3535
3636### Ramstack.FileProviders.Extensions
37- Offers useful and convenient extensions for ` IFileProviders ` , bringing its capabilities and experience
38- closer to what's provided by the ` DirectoryInfo ` and ` FileInfo ` standard classes.
37+ Offers useful and convenient extensions for ` IFileProvider ` , bringing its capabilities and experience
38+ closer to what's provided by the ` DirectoryInfo ` and ` FileInfo ` classes.
3939
4040To install the ` Ramstack.FileProviders.Extensions ` [ NuGet package] ( https://www.nuget.org/packages/Ramstack.FileProviders.Extensions ) in your project,
4141run the following command:
@@ -87,12 +87,12 @@ This is useful when you need to organize files in a virtual hierarchy.
8787
8888Example:
8989``` csharp
90- IFileProvider provider = new PrefixedFileProvider (innerProvider , " /project/app" );
90+ IFileProvider provider = new PrefixedFileProvider (" /project/app" , innerProvider );
9191IFileInfo file = provider .GetFileInfo (" /project/app/docs/README" );
9292Console .WriteLine (file .Exists );
9393```
9494
95- This is how you can add virtual directories to your project that are external to the project root:
95+ This is how you can add virtual directories to your project that are outside the project root:
9696``` csharp
9797string packagesPath = Path .Combine (environment .ContentRootPath , " ../Packages" );
9898string themesPath = Path .Combine (environment .ContentRootPath , " ../Themes" );
@@ -129,11 +129,11 @@ as if they were originally defined within your project.
129129├── Models
130130├── Views
131131├── Packages <-- (virtual)
132- │ ├── package1
133- │ └── package2
132+ │ ├── package-1
133+ │ └── package-2
134134├── Themes <-- (virtual)
135- │ ├── theme1
136- │ └── theme2
135+ │ ├── theme-1
136+ │ └── theme-2
137137└── wwwroot
138138```
139139
@@ -143,29 +143,29 @@ as if they were originally defined within your project.
143143
144144Example:
145145``` csharp
146- IFileProvider provider = new SubFileProvider (innerProvider , " /docs" );
146+ IFileProvider provider = new SubFileProvider (" /docs" , innerProvider );
147147IFileInfo file = provider .GetFileInfo (" /README" );
148148Console .WriteLine (file .Exists );
149149```
150150
151151### Ramstack.FileProviders.Globbing
152152
153- ` GlobbingFileProvider ` class filters files using include and/or exclude glob patterns. Include patterns make only matching files visible,
153+ The ` GlobbingFileProvider ` class filters files using include and/or exclude glob patterns. Include patterns make only matching files visible,
154154while exclude patterns hide specific files. Both include and exclude patterns can be combined for flexible file visibility control.
155155
156156It relies on the [ Ramstack.Globbing] ( https://www.nuget.org/packages/Ramstack.Globbing ) package for its globbing capabilities.
157157
158158Example:
159159``` csharp
160- IFileProvider provider = new GlobbingFileProvider (innerProvider , patterns : [" **/*.txt" , " docs/*.md" ], excludes : [" **/README.md" ]);
160+ IFileProvider provider = new GlobbingFileProvider (innerProvider , patterns : [" **/*.txt" , " docs/*.md" ], excludes : [" **/README.md" ]);
161161foreach (IFileInfo file in provider .GetDirectoryContents (" /" ))
162162 Console .WriteLine (file .Name );
163163```
164164
165165### Ramstack.FileProviders.Extensions
166166
167- Provides useful extensions for ` IFileProvider ` , bringing its capabilities and experience closer to what's being
168- provided by ` DirectoryInfo ` and ` FileInfo ` classes.
167+ Provides useful extensions for ` IFileProvider ` , bringing its capabilities and experience closer to what's
168+ provided by the ` DirectoryInfo ` and ` FileInfo ` classes.
169169
170170Simply stated, a ` FileNode ` knows which directory it is located in, and a directory represented by the ` DirectoryNode ` class can access
171171its parent directory and list all files within it, recursively.
@@ -242,15 +242,15 @@ builder.Environment.ContentRootFileProvider = FileProviderComposer.FlattenProvid
242242#### Composing Providers
243243
244244The ` ComposeProviders ` method combines a list of ` IFileProvider ` instances into a single ` IFileProvider ` .
245- During this process, all encountered ` CompositeFileProvider ` instances recursively flattened and merged into a single level.
246- This eliminates unnecessary indirectness and streamline the file provider hierarchy.
245+ During this process, all encountered ` CompositeFileProvider ` instances are recursively flattened and merged into a single level.
246+ This eliminates unnecessary indirectness and streamlines the file provider hierarchy.
247247
248248``` csharp
249249string packagesPath = Path .Combine (environment .ContentRootPath , " ../Packages" );
250250string themesPath = Path .Combine (environment .ContentRootPath , " ../Themes" );
251251
252252environment .ContentRootFileProvider = FileProviderComposer .ComposeProviders (
253- // Inject external Modules directory
253+ // Inject external Packages directory
254254 new PrefixedFileProvider (" /Packages" , new PhysicalFileProvider (packagesPath )),
255255
256256 // Inject external Themes directory
@@ -261,7 +261,7 @@ environment.ContentRootFileProvider = FileProviderComposer.ComposeProviders(
261261```
262262
263263In this example, the ` ComposeProviders ` method handles any unnecessary nesting that might occur, including when the current
264- ` environment.ContentRootFileProvider ` is a ` CompositeFileProvider ` . This ensures that all file providers merged into a single
264+ ` environment.ContentRootFileProvider ` is a ` CompositeFileProvider ` . This ensures that all file providers are merged into a single
265265flat structure, avoiding unnecessary indirectness.
266266
267267#### Flattening Change Tokens
0 commit comments