私は一緒に働いてNop Commerceおり、誰かが私の混乱を助けてくれるかどうか疑問に思っています。
Webアプリケーションの起動時に設定がどのように読み込まれるかを調べようとして、コードを何度もデバッグしました。わからない!
すべての設定クラスはISettingsインターフェースを実装します。顧客の設定を例にとってみましょう。CustomerSettingsクラスによって表されていることがわかりました。データベースには。がありますSetting table。顧客設定のデータは次のようになります。
customersettings.usernamesenabled
customersettings.checkusernameavailabilityenabled
customersettings.allowuserstochangeusernames
... and so on...
これらの各設定は、どのように、どこからcustomersettingsクラスCustomerSettingsにusernamesenabledマップされ、UsernamesEnabledプロパティは、CustomerSettingsクラスのプロパティにマップされますか?そして、なぜそれがこのように実装されたのですか?
私はそれがDependencyRegistrarクラスの次のコードと関係があることを知っています:
builder.RegisterGeneric(typeof(ConfigurationProvider<>)).As(typeof(IConfigurationProvider<>));
builder.RegisterSource(new SettingsSource());
誰かが私を正しい方向に向けることができれば、それはありがたいです。