using Hwdtech;
using Hwdtech.Ioc;
using HwdTechIocSandbox;
string Say(string text)
{
return text;
}
Func<string, string> a = Say;
a("Text");
new InitScopeBasedIoCImplementationCommand().Execute();
IoC.Resolve<Hwdtech.ICommand>("IoC.Register", "HelloString", (object[] args) => new string("Hello, " + args[0])).Execute();
IoC.Resolve<Hwdtech.ICommand>("IoC.Register", "Cat", (object[] args) => new Animal
{
Name = (string)args[0],
Age = (int)args[1],
Say = (Func<string, string>)args[2]
}).Execute();
var service = new MyService();
service.Do();
var catVasya = IoC.Resolve<Animal>("Cat", "Vasya", 10, (string text) => text + text);
Console.WriteLine(catVasya.Say("Hello"));
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HwdTechIocSandbox
{
public class Animal
{
public string Name { get; set; }
public int Age { get; set; }
public Func<string, string> Say;
}
}