转载请注明出处:http://www.cnblogs.com/zhiyong-ITNote/

在基于dotnet core的web开发中,我们会经常用到DI,那么如果单单使用dotnet core自身提供的一整套DI程序,该如何来实现呢?
直接上代码吧:

public interface IBar
{
    void MethodOne();

    void MethodTwo();
}
public class Bar : IBar
{
    public void MethodOne()
    {
        Console.WriteLine("MethOne....");
    }

    public void MethodTwo()
    {
        Console.WriteLine("MethTwo....");
    }
}
View Code

相关文章:

  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-04-29
猜你喜欢
  • 2021-11-23
  • 2021-09-09
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案