Autofac and IDisposable interface

后端 未结 2 1417
野性不改
野性不改 2021-02-05 12:54

Assuming that I have the following interface and class:

public interface IFooRepo : IDisposable { 

    //...
}

public FooRepo : IFooRepo { 

    //Methods here         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 13:37

    This portion comes into lifetime management in IOC or DI Container.

    As you are using AutoFac following link may help you. http://autofac.readthedocs.io/en/latest/lifetime/disposal.html

    Also look at section of "Controlling scope and lifetime" for autofac.

提交回复
热议问题