Created
January 16, 2020 15:05
-
-
Save kasunkv/6941cbb3fea6d46b9c8067cec8529754 to your computer and use it in GitHub Desktop.
Blocking access to Controller Action methods using FeatureGate action filter.
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
using Microsoft.FeatureManagement.Mvc; | |
namespace MusicStore.Web.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
... | |
[FeatureGate(Features.Promotions)] | |
public async Task<IActionResult> Promotions() | |
{ | |
var promoAlbums = await _albumService.PromotionalAlbumsAsync(); | |
return View(promoAlbums); | |
} | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment