StructureMap singleton usage (A class implementing two interface)

后端 未结 4 427
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 04:46
public interface IInterface1
{
}

public interface IInterface2
{
}

public class MyClass : IInterface1, IInterface2
{
}

...

ObjectFactory.Initialize(x =>
{
             


        
4条回答
  •  失恋的感觉
    2020-12-01 04:59

    Try looking at the different overloads to Use, especially Func overload. From there you can tell how StructureMap should create your instance with another object already registred.

提交回复
热议问题