From f027760400089fbb5b778c1add09ced6f825f20c Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Mon, 4 Mar 2019 18:04:58 +0300 Subject: [PATCH] Implemented RemoteFeatureChecker. --- .../Mvc/Client/RemoteFeatureChecker.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs new file mode 100644 index 0000000000..0643620ec9 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/RemoteFeatureChecker.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Features; + +namespace Volo.Abp.AspNetCore.Mvc.Client +{ + public class RemoteFeatureChecker : FeatureCheckerBase + { + protected ICachedApplicationConfigurationClient ConfigurationClient { get; } + + public RemoteFeatureChecker(ICachedApplicationConfigurationClient configurationClient) + { + ConfigurationClient = configurationClient; + } + + public override async Task GetOrNullAsync(string name) + { + var configuration = await ConfigurationClient.GetAsync(); + return configuration.Features.Values.GetOrDefault(name); + } + } +}