src/packages/EmbedIO/Files/FileModuleExtensions.cs
/// <summary>
/// Enables caching of file contents and directory listings on a module.
/// </summary>
/// <typeparam name="TModule">The type of the module on which this method is called.</typeparam>
/// <param name="this">The module on which this method is called.</param>
/// <param name="maxFileSizeKb"><see langword="true"/> sets the maximum size of a single cached file in kilobytes</param>
/// <param name="maxSizeKb"><see langword="true"/> sets the maximum total size of cached data in kilobytes</param>
/// <returns><paramref name="this"/> with its <see cref="FileModule.ContentCaching">ContentCaching</see> property
/// set to <see langword="true"/>.</returns>
/// <exception cref="NullReferenceException"><paramref name="this"/> is <see langword="null"/>.</exception>
/// <exception cref="InvalidOperationException">The configuration of <paramref name="this"/> is locked.</exception>
/// <seealso cref="FileModule.ContentCaching"/>
Enables caching of file contents and directory listings on a module.
Enables caching of file contents and directory listings on a module .
public static TModule WithContentCaching<TModule>(this TModule @this, int maxFileSizeKb, int maxSizeKb)
            where TModule : FileModule
        {
            @this.ContentCaching = true;
            @this.Cache.MaxFileSizeKb = maxFileSizeKb;
            @this.Cache.MaxSizeKb = maxSizeKb;
            return @this;
        }
public static TModule WithContentCaching < TModule > ( this TModule @this , int maxFileSizeKb , int maxSizeKb ) where TModule : FileModule { @this . ContentCaching = true ; @this . Cache . MaxFileSizeKb = maxFileSizeKb ; @this . Cache . MaxSizeKb = maxSizeKb ; return @this ; }
Enables caching of file contents and directory listings on a module.
Enables caching of file contents and directory listings on a module .
with its ContentCaching.
with its ContentCaching .
None
The configuration of  is locked.
The configuration of is locked .
TModule
this
maxFileSizeKb
int
sets the maximum size of a single cached file in kilobytes
sets the maximum size of a single cached file in kilobytes
maxSizeKb
int
sets the maximum total size of cached data in kilobytes
sets the maximum total size of cached data in kilobytes
this
The module on which this method is called.
The module on which this method is called .
typeparam
The type of the module on which this method is called.
The type of the module on which this method is called .
seealso
None