コード例 #1
0
ファイル: IoCTests.cs プロジェクト: kouweizhong/PortableIoC
        public void GivenNewInstanceWhenInterfaceRequestedThenShouldReturnInstance()
        {
            var actual = _target.Resolve <IPortableIoC>();

            Assert.AreSame(_target, actual, "Test failed: container did not resolve to self.");
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: vapps/CrossPlatform
 public static TService GetInstance <TService>(string label = "") where TService : class
 {
     return(container.Resolve <TService>(label));
 }
コード例 #3
0
 public static T Resolve <T>(bool createNew = true)
 {
     return(_instance.Resolve <T>(createNew));
 }