static void Main(string[] args) { Console.WriteLine("Program Starting..."); // Assembly[] ass = AssemblyDiscovery.Discovery(); IServiceCollection sc = new ServiceCollection(); sc.AddScanServices(); var hostingServiceProvider = sc.BuildServiceProvider(); IServiceTest t = hostingServiceProvider.GetService <IServiceTest>(); t.TestM(); IEnumerable <AbstractTest> t1 = hostingServiceProvider.GetServices <AbstractTest>(); foreach (var item in t1) { item.M(); } IGenericTest <AbstractImpTest> t2 = hostingServiceProvider.GetService <IGenericTest <AbstractImpTest> >(); Console.WriteLine("Press Enter to Quit."); Console.ReadLine(); }
public void GenericMethodTest() { dynamic ot = new OtherThing(); IGenericTest test = Impromptu.ActLike(ot); var tResult = test.GetThings <Thing>(Guid.Empty); Assert.AreEqual(true, tResult is List <Thing>); }
public HomeController(IGenericTest <ApplicationDbContext> genTest, ApplicationDbContext context) { _genTest = genTest; _context = context; var number = 1234; var number2 = number; var name = "hansje"; try { } catch (Exception ex) { throw; } finally { } }