は、私はこのようなサービスを使用して自分のWeb層(S#のARPアーキテクチャ)に石鹸Webサービスを持っています再度IReportServiceの実装の?S#のARP城注入
ありがとうございました。ここで
クリスチャン
は、私はこのようなサービスを使用して自分のWeb層(S#のARPアーキテクチャ)に石鹸Webサービスを持っています再度IReportServiceの実装の?S#のARP城注入
ありがとうございました。ここで
クリスチャン
短い答えはです。ReportServiceをyourProject.ApplicationServicesに挿入するだけで注入されます。
長い答えはです:Global.asaxのyourProject.Webには、InitializeServiceLocator()メソッドがあります。これにより、ComponentRegistrarの静的メソッドAddComponentsが呼び出されます。
ComponentRegistrarは、YourProject.web/CastleWindsorにあります。
private static void AddApplicationServicesTo(IWindsorContainer container)
{
container.Register(
AllTypes.Pick()
.FromAssemblyNamed("NewittsStore.ApplicationServices")
.WithService.FirstInterface());
}
がComponentRegistrar.csからです:
/// <summary>
/// The add application services to.
/// </summary>
/// <param name="container">
/// The container.
/// </param>
private static void AddApplicationServicesTo(IWindsorContainer container)
{
container.Register(AllTypes.Pick().FromAssemblyNamed("MyAssembly.ApplicationServices").WithService.FirstInterface());
}
、ここでは、これはあなたを助ける必要があるサービス
private readonly IDocumentManagementService _client;
public DocumentService(IDocumentManagementService client)
{
_client = client;
}
からです。
私はこのような何かを試してみました。そこでは、あなたがAddApplicationServicesToを見ればあなたはそれがレジスタyourProject.ApplicationServicesのすべての型(.WithService.FirstInterface())で見ることができます
があります。 OK私が追加しました:プライベート静的ボイドAddWebTo(IWindsorContainer容器) {container.Register( AllTypes.Pick() .FromAssemblyNamed( "College.Web") .WithService.FirstInterface())。 }サービス層にWebサービスを追加すべきかどうかはわかりません。 – cs0815