Microsoft Azure Team developed Function management (Feature Management) package Microsoft.FeatureManagement Can be used to implement Function switch , Can pass Function switch Features dynamically change the behavior of the application without changing any business logic code . For more functions of the function switch, please see Edi Wang Of B Stop video :

The focus of this article is to introduce how to Blazor WebAssembly Function switch is realized in the project .

adopt NuGet install Microsoft.FeatureManagement , It can be done by Visual Studio 2019 Under the NuGet Package Manager Visual management interface perhaps adopt .NET CLI The command line tool enters the following command .

dotnet add package Microsoft.FeatureManagement

In order to be able to use Function management , Need to be in ConfigureServices The method was used in the experiment service Inject , As shown in the following code :

There is one caveat : Function management Medium Function switch The value read comes from the configuration file , If you want to make Function switch Value from Configuration Different nodes of the file , Must be in service When you register, specify it separately .

In order to be able to Blazor Wassembly I use it in my life Function management (feature management), We need to inject it into Blazor In the component :

Call in use IFeatureManager Interface method IsEnabledAsync, The code is as follows :

The usage is very simple , You can see .NET Right Function management Provides out of the box support , It's really a very practical feature , More about Knowledge point Introduction to , Please refer to the official website :https://docs.microsoft.com/en-us/azure/azure-app-configuration/use-feature-flags-dotnet-core

For the screenshot code in this article, please refer to :https://github.com/geffzhang/Abp.BootstrapTheme 

How to be in Blazor WebAssembly in Use More articles on function switches

  1. Blazor(WebAssembly) + .NETCore To fight the landlords

    Before, the great God of the group sent a html5+ .NETCore Fight against the landlord , Just looking at Blazor WebAssembly  Just try to rewrite it . There are also some party headlines , Because there is almost no realization of fighting landlords in this article :), Here we mainly introduce ...

  2. In the browser .Net Core —— Blazor WebAssembly First experience

    Preface I heard about it more than two years ago Blazor frame , yes .Net My father's amateur experimental project , Its purpose is to explore .Net And WebAssembly Compatibility and application prospect of . Now the project has officially become Asp.Net Co ...

  3. How to be in “ Code ” View and make the most of Dreamweaver The coding function of . Such as Emmet abbreviation

    There are many ways to Dreamweaver Processing code in . You can use “ New document ” Dialog box to open a new code file , Then start typing your code . stay Dreamweaver Create a new code file in As you type , A code prompt will be displayed to help ...

  4. Use WebApi and Asp.Net Core Identity authentication Blazor WebAssembly(Blazor Client applications )

    original text :https://chrissainty.com/securing-your-blazor-apps-authentication-with-clientside-blazor-using-web ...

  5. Blazor WebAssembly 3.2.0 Preview 4 Release as scheduled

    ASP.NET The team is on schedule 3.16 On the official blog Blazor WebAssembly 3.2.0 Preview 4:https://devblogs.microsoft.com/aspnet/bla ...

  6. Blazor WebAssembly 3.2.0 It's in place on the tower Will launch a new generation of front end SPA frame

    The most beautiful April day in the world , The light of spring does not disappoint the passers-by . In the bright spring full of infinite hope , All the way through .NET The team is struggling to achieve new breakthroughs . According to the plan , The new generation is based on WebAssembly The front end of technology development SPA frame Blazor Will be in 5 month 1 ...

  7. Blazor WebAssembly 3.2.0 Take off ,blazor Is it right for you ?

    lately blazor Update soon , It was posted on the official blog today Blazor WebAssembly 3.2.0 RC:https://devblogs.microsoft.com/aspnet/blazor-web ...

  8. ASP.NET Core Blazor A preliminary study Blazor WebAssembly

    lately Blazor The heat is very high , The legend will be released soon , As Microsoft brain powder , Hurry up and join in the fun , To learn . Blazor Blazor It's Microsoft. ASP.NET Core Under the framework of the development of a new Web Development framework .Bla ...

  9. Blazor WebAssembly 3.2 Official release

    5 month 20 Japan , Microsoft Released Blazor WebAssembly 3.2(https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0- ...

  10. Blazor WebAssembly Notes on migration of candidate version

    Preface I wrote an article about Blazor WebAssembly In the article browser of .Net Core —— Blazor WebAssembly First experience , Now it has been updated to RC-1, There is a big difference with the preview version ...

Random recommendation

  1. Asp.net MVC4 And Web Form Coexist

          Web Forms And MVC Of asp.net The infrastructure is the same .MVC Our routing mechanism is not just MVC Peculiar , It is associated with WebForm Also share the same routing mechanism .Web Forms Of Http Request pin ...

  2. Two sets of two hrbeu.acm.1211Kth Largest

    Kth Largest TimeLimit: 1 Second   MemoryLimit: 32 Megabyte Description There are two sequences A and ...

  3. Failed to load properly “Microsoft.VisualStudio.Editor.Implementation.EditorPackage,

    Failed to load properly “Microsoft.VisualStudio.Editor.Implementation.EditorPackage, Microsoft.VisualStudio.Editor.Imp ...

  4. To configure Ubuntu development environment

    Preface I bought a new one ThinkPad E431, The main focus is on the hard disk 500G and 7200 turn / Minute speed , So prepare to start from x220 Move your work environment to your new laptop . Why not use a company computer , Is due to 160G Of ssd Hard drives are really ...

  5. Unity utilize Coroutine Realize the digital effect

    Pure reprint : Reprint with reference link ! Reference link :http://xataxnova.blog.163.com/blog/static/236620063201451061738122/, author : Netease blog  xata ...

  6. RMAN Backup FORMAT In the format % The meaning of

    Let's look at the example first :Configure channel 1 device type disk format 'd:/backup/orcl/backup_%U'; stay configure Lattice is often used in commands ...

  7. Hadoop Management tools HUE To configure -HBase To configure

    1 Preface First of all, I have to accompany you HBase, You can see http://www.cnblogs.com/liuchangchun/p/4096891.html, Completely distributed, like 2 HBase To configure 2.1 HUE To configure ...

  8. sql server Backup and recovery series four Backup and restore in large capacity mode

    One . summary stay sql server In the first part of the backup and recovery series , I have knowledge about backup and restore in large capacity mode . This article focuses on demonstrating the backup and restore modes commonly used in large capacity mode “ Full backup + Differential backup + Log backup ”. In high capacity recovery mode ...

  9. HDU 4549 M Fibonacci sequence ( Matrix fast power )

    Topic link :M Fibonacci sequence The question :$F[0]=a,F[1]=b,F[n]=F[n-1]*F[n-2]$. Given $a,b,n$, seek $F[n]$. Answer key : After the violence, I found that $ F[n]=a^{fib(n-1)} ...

  10. CentOS 7.4 The Internet is slow , modify DNS!

    Modify the DNS,vi /etc/resolv.conf Original configuration : nameserver 223.5.5.5 It is amended as follows : nameserver 114.114.114.114