LayoutCssBundleScript constructor
A predefined dynamic CSS bundle that concatenates the layout CSS files declared with LayoutCssFileAttribute. It is registered under ScriptName at startup, so it can be referenced from a bundle definition (e.g. dynamic://CssBundle.LayoutCssFiles) or rendered with @Html.Stylesheet("dynamic://CssBundle.LayoutCssFiles").
public LayoutCssBundleScript(ILayoutCssFileProvider fileProvider, ICssBundleBuilder bundleBuilder,
Func<string, bool>? filter = null)
| parameter | description |
|---|---|
| fileProvider | The layout CSS file provider. |
| bundleBuilder | The CSS bundle builder. |
| filter | An optional filter applied to the file urls, e.g. to exclude the files of an assembly. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | One of the arguments is null. |
Remarks
The files are the ones GetFiles returns for the current request, e.g. filtered by feature toggles and the permissions of the current user. A hash of the file list is the CacheSuffix, so each distinct file set is generated and cached separately, and has its own content hash in urls. The bundle itself is public, as it only contains the files the requesting user may load. Initializes a new instance of the LayoutCssBundleScript class.
See Also
- interface ILayoutCssFileProvider
- interface ICssBundleBuilder
- class LayoutCssBundleScript