コード例 #1
0
 // Interface is better still
 public void DoSomething1(IServiceThatSingletonImplements singleton)
 {
     // do something with the singleton instance
 }
コード例 #2
0
 // interface is even better
 public SingletonTesting(IServiceThatSingletonImplements singleton)
 {
     _singleton2 = singleton;
 }