static void Main(string[] args) { var service = new HelloService(); var controller = new HomeController(service); string greeting = controller.Index("Stephanie"); Console.WriteLine(greeting); }
private static void UseDependencyInjection() { IHelloService hello = new HelloService(); var greetingController = new HelloController(hello); string result = greetingController.Greeting("Tobi"); Console.WriteLine(result); }
public string Greeting(string name) { var service = new HelloService(); return(service.Hello(name)); }