【问题标题】:Abp Boilerplate Abp.Feature.AllFeatures to C#Abp 样板 Abp.Feature.AllFeatures 到 C#
【发布时间】:2018-07-24 12:11:53
【问题描述】:

我正在使用 abp 样板。 在我的客户端,我读出了特性并设置了新值。如何将这些功能保存到我的数据库中。

在客户端功能是正确的,但是在我的 asp.net 后端这些功能的类型是什么

我已经尝试过例如:

public List<IFeatureDefinitionContext> Licences { get; set; }
public Dictionary<FeatureValueStore, Feature> LicencesList { get; set; }
public List<FeatureSetting> LicencesSetting { get; set; }
public List<Feature> LicencesTest { get; set; }
public List<FeatureDictionary> LicencesDictionary { get; set; }

在客户端: 获取值: $scope.licenceValues = abp.features.allFeatures;

编辑值并保存:

appService.saveLicences($scope.licenceValues);

在这里,我尝试了一些许可 licencesList、设置等

var saveLicences = function (licences) {
            var deferred = $q.defer();
            abp.ui.setBusy(
                null,
                localizationService.saveLicences({
                    licences: licences,
                    licencesList: licences,
                    licencesSetting: licences,
                    licencesDictionary: licences
        })
                .success(function (data) {
                    deferred.resolve(data);
                    abp.notify.success(abp.utils.formatString(localize("ConfigSaved"), ''));
                }).error(function (response) {
                    deferred.reject(response);
                })
            );
            return deferred.promise;
        };

在我的 application.dll 项目中应该显示这些值...

【问题讨论】:

    标签: c# aspnetboilerplate


    【解决方案1】:

    虽然我不能清楚地理解你的问题;我猜你需要特性的定义,所以你可以注入和使用IFeatureManager

    请看https://aspnetboilerplate.com/Pages/Documents/Feature-Management

    【讨论】:

    • 0 反对票接受我在我的 JavaScript 函数中使用 abp.features.allFeatures。现在我想将在我的 js 代码中设置的新功能保存到数据库中,但是我应该在 C# abp.features.allFeatures = C# List 或 Dictionary 等中选择哪种类型
    猜你喜欢
    • 1970-01-01
    • 2016-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多