-
Notifications
You must be signed in to change notification settings - Fork 0
/
BundlingApplicationBuilderExtensions.cs
37 lines (33 loc) · 1.22 KB
/
BundlingApplicationBuilderExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Web.Optimization;
using Microsoft.AspNetCore.Builder;
namespace Microsoft.AspNet.Hosting.SystemWeb
{
/// <summary>
/// Contains extension methods to <see cref="IApplicationBuilder"/>.
/// </summary>
public static class BundlingApplicationBuilderExtensions
{
/// <summary>
/// Adds bundling to the <see cref="IApplicationBuilder"/> request execution pipeline.
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/>.</param>
/// <param name="configureDelegate">Delegate to configure the bundles.</param>
/// <returns>The <see cref="IApplicationBuilder"/> so that additional calls can be chained.</returns>
public static IApplicationBuilder UseBundling(
this IApplicationBuilder app,
Action<BundleCollection> configureDelegate)
{
if (app == null)
{
throw new ArgumentNullException(nameof(app));
}
if (configureDelegate == null)
{
throw new ArgumentNullException(nameof(configureDelegate));
}
configureDelegate(BundleTable.Bundles);
return app;
}
}
}