示例#1
0
        public async Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdateFeaturesDto input)
        {
            await CheckProviderPolicy(providerName);

            foreach (var feature in input.Features)
            {
                await _featureManager.SetAsync(feature.Name, feature.Value, providerName, providerKey);
            }
        }
示例#2
0
    public async Task Test_HandleContextAsync()
    {
        var featureValue = await _featureValueRepository.FindAsync(
            TestFeatureDefinitionProvider.EmailSupport,
            TenantFeatureValueProvider.ProviderName,
            TestEditionIds.TenantId.ToString()
            );

        featureValue.ShouldNotBeNull();
        featureValue.Value.ShouldBe(false.ToString().ToLower());


        featureValue = await _featureValueRepository.FindAsync(
            TestFeatureDefinitionProvider.EmailSupport,
            NextTenantFeatureManagementProvider.ProviderName,
            TestEditionIds.TenantId.ToString()
            );

        featureValue.ShouldNotBeNull();
        featureValue.Value.ShouldBe(true.ToString().ToLower());

        await _featureManager.SetAsync(TestFeatureDefinitionProvider.EmailSupport, true.ToString().ToLower(),
                                       TenantFeatureValueProvider.ProviderName, TestEditionIds.TenantId.ToString());

        featureValue = await _featureValueRepository.FindAsync(
            TestFeatureDefinitionProvider.EmailSupport,
            TenantFeatureValueProvider.ProviderName,
            TestEditionIds.TenantId.ToString()
            );

        featureValue.ShouldBeNull();

        featureValue = await _featureValueRepository.FindAsync(
            TestFeatureDefinitionProvider.EmailSupport,
            NextTenantFeatureManagementProvider.ProviderName,
            TestEditionIds.TenantId.ToString()
            );

        featureValue.ShouldNotBeNull();
        featureValue.Value.ShouldBe(true.ToString().ToLower());
    }
 public static Task SetForEditionAsync(this IFeatureManager featureManager, Guid editionId, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false)
 {
     return(featureManager.SetAsync(name, value, EditionFeatureValueProvider.ProviderName, editionId.ToString(), forceToSet));
 }
示例#4
0
 public static Task SetForEditionAsync(this IFeatureManager featureManager, string clientId, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false)
 {
     return(featureManager.SetAsync(name, value, ClientFeatureValueProvider.ProviderName, clientId, forceToSet));
 }
示例#5
0
 public static Task SetForUserAsync(this IFeatureManager featureManager, Guid userId, string name, string value, bool forceToSet = false)
 {
     return(featureManager.SetAsync(name, value, UserFeatureValueProvider.ProviderName, userId.ToString(), forceToSet));
 }
 public static Task SetForCurrentTenantAsync(this IFeatureManager featureManager, [NotNull] string name, [CanBeNull] string value, bool forceToSet = false)
 {
     return(featureManager.SetAsync(name, value, TenantFeatureValueProvider.ProviderName, null, forceToSet));
 }