0
如果我有一個類,它在幾個構造函數參數,包括一個字符串,可以爲空,我目前使用以下語法對其進行註冊:Unity流利註冊 - 可以縮短嗎?
container.RegisterType<ISomething, Something>(
new InjectionConstructor(new InjectionParameter<string>(aString), typeof(ISomethingHelper), typeof(ISomethingManager)))
我加InjectionParameter應付空的情況下, aString沒有這個,Unity抱怨。
這是所有必要或我可以精簡一下?