Created
September 30, 2018 17:46
-
-
Save abfo/b1cef45795c7aeebd145bfc8596db70b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult InlineCss() | |
{ | |
BundleContext context = new BundleContext( | |
new HttpContextWrapper(System.Web.HttpContext.Current), | |
BundleTable.Bundles, | |
"~/Content/css"); | |
Bundle cssBundle = BundleTable.Bundles.GetBundleFor("~/Content/css"); | |
BundleResponse response = cssBundle.GenerateBundleResponse(context); | |
CssMinify cssMinify = new CssMinify(); | |
cssMinify.Process(context, response); | |
return Content(response.Content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment