特定の患者に対して何らかの作業を行うサービス オブジェクトがあります。
public class PatientDxService
{
public Patient Patient { get; set; }
public PatientDxService(Patient patient)
{
this.Patient = patient;
}
}
上記のように、私のサービスは患者オブジェクトを受け取ります。
SessionManager
セッションの患者を取得するプロパティを持つオブジェクトがあります。患者に注射したい。
Bind<PatientDxService>().ToConstructor(x => new PatientDxService(x.Inject<ISessionManager>().Patient));
Bind<ISessionManager>().To<SessionManager>().InSingletonScope();
上記は私にはうまくいきません。ISessionManager
Web スコープ外でサービスを使用したい場合、それは意味がないため、実際には挿入したくありません。