From b2f5419176713990cf33e71c08133bde191fedde Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 26 Dec 2024 17:02:51 +0800 Subject: [PATCH] Update POST.md --- .../2024-11-25-Global-Assets/POST.md | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/docs/en/Community-Articles/2024-11-25-Global-Assets/POST.md b/docs/en/Community-Articles/2024-11-25-Global-Assets/POST.md index 837f81bfa0..33dd9eb292 100644 --- a/docs/en/Community-Articles/2024-11-25-Global-Assets/POST.md +++ b/docs/en/Community-Articles/2024-11-25-Global-Assets/POST.md @@ -219,19 +219,11 @@ public class MyProjectNameScriptBundleContributor : BundleContributor ```cs Configure(options => { - options - .StyleBundles - .Add(BlazorStandardBundles.Styles.Global, bundle => - { - bundle.AddContributors(typeof(MyProjectNameStyleBundleContributor)); - }); - - options - .ScriptBundles - .Add(BlazorStandardBundles.Scripts.Global, bundle => - { - bundle.AddContributors(typeof(MyProjectNameScriptBundleContributor)); - }); + var globalStyles = options.StyleBundles.Get(BlazorWebAssemblyStandardBundles.Styles.Global); + globalStyles.AddContributors(typeof(MyProjectNameStyleBundleContributor)); + + var globalScripts = options.ScriptBundles.Get(BlazorWebAssemblyStandardBundles.Scripts.Global); + globalScripts.AddContributors(typeof(MyProjectNameScriptBundleContributor)); }); ``` @@ -285,19 +277,11 @@ public class MyProjectNameScriptBundleContributor : BundleContributor ```cs Configure(options => { - options - .StyleBundles - .Add(BlazorStandardBundles.Styles.Global, bundle => - { - bundle.AddContributors(typeof(MyProjectNameStyleBundleContributor)); - }); - - options - .ScriptBundles - .Add(BlazorStandardBundles.Scripts.Global, bundle => - { - bundle.AddContributors(typeof(MyProjectNameScriptBundleContributor)); - }); + var globalStyles = options.StyleBundles.Get(BlazorWebAssemblyStandardBundles.Styles.Global); + globalStyles.AddContributors(typeof(MyProjectNameStyleBundleContributor)); + + var globalScripts = options.ScriptBundles.Get(BlazorWebAssemblyStandardBundles.Scripts.Global); + globalScripts.AddContributors(typeof(MyProjectNameScriptBundleContributor)); }); ```