public delegate string ServiceDelegate(ViewModel vm);
public static void Main()
object service = DependencyInjectionSimulator.Resolve();
Type type = service.GetType();
MethodInfo method = type.GetMethod("Add");
ServiceDelegate serviceDelegate = (ServiceDelegate)Delegate.CreateDelegate(typeof(ServiceDelegate), service, method);
var car = new CarViewModel();
Console.WriteLine(serviceDelegate(car));
public string Add(CarViewModel input)
public string Name { get; set; }
public class CarViewModel : ViewModel
public static class DependencyInjectionSimulator
public static object Resolve()