次の一般的なライフタイムマネージャーがあります
public class RequestLifetimeManager<T> : LifetimeManager, IDisposable
{
public override object GetValue()
{
return HttpContext.Current.Items[typeof(T).AssemblyQualifiedName];
}
public override void RemoveValue()
{
HttpContext.Current.Items.Remove(typeof(T).AssemblyQualifiedName);
}
public override void SetValue(object newValue)
{
HttpContext.Current.Items[typeof(T).AssemblyQualifiedName] = newValue;
}
public void Dispose()
{
RemoveValue();
}
}
ユニティ構成セクションでこれを参照するにはどうすればよいですか。タイプ エイリアスの作成
<typeAlias alias="requestLifeTimeManager`1" type=" UI.Common.Unity.RequestLifetimeManager`1, UI.Common" />
ライフタイムマネージャーとして指定する
<types>
<type type="[interface]" mapTo="[concretetype]" >
<lifetime type="requestLifeTimeManager`1" />
</type>
</types>
次のエラーが発生します
Cannot create an instance of UI.Common.Unity.RequestLifetimeManager`1[T] because Type.ContainsGenericParameters is true.
ジェネリック ライフタイム マネージャーをどのように参照しますか?