私は次のものを持っています:
interface IAncestor { }
interface IDescendant1 : IAncestor { }
interface IDescendant2 : IAncestor { }
class Descendant1 : IDescendant1 { }
class Descendant2 : IDescendant2 { }
私ができるようにしたいのは、Castle Windsor が自動的にすべてのペアを見つけられるようにすることIDescendantX
ですDescendantX
。手動で指定する必要はありません。これは可能ですか?
私はもう試した:
container.Register(
Classes.FromThisAssembly()
.BasedOn<IAncestor>()
.WithService.DefaultInterfaces()
.LifestyleTransient()
);
しかし、これはデフォルトのインターフェースを見つけません。(正しい用語で質問を表現するのに問題があるため、すでにこれに回答しているトピックを見つけることができませんでした。重複している場合は申し訳ありません...)