mirror of
https://github.com/Stone-Red-Code/DynamicInjector.git
synced 2026-09-04 09:06:06 +02:00
19 lines
471 B
C#
19 lines
471 B
C#
using DynamicInjector;
|
|
|
|
namespace DynamicInjector_Test;
|
|
|
|
internal class Prgramm
|
|
{
|
|
private static void Main()
|
|
{
|
|
InjectionContainer injector = new InjectionContainer();
|
|
injector.RegisterGlobal<IFirstTestService, FirstTestService>();
|
|
injector.RegisterLocal<SecondTestService>();
|
|
|
|
TestClass? testClass = injector.Resolve<TestClass>();
|
|
|
|
testClass.Test();
|
|
|
|
injector.Invoke<TestClass>(testClass, (c) => c.Test);
|
|
}
|
|
} |