public static void Main() { var service = new VideoService(); var title = service.ReadVideoTitle(); var loader = new FileDownloader(); loader.GetFile("123", "123"); }
public static void Main() { var service = new VideoService(); var title = service.ReadVideoTitle(); //Dep Injection via Method Parameters //var title = service.ReadVideoTitle(new FileReader()); }
// Simulate using Video Services Class public static void Main() { // ARRANGE var service = new VideoService(); // Method Parameter // var title = service.ReadVideoTitle(new FileReader()); // ACT var result = service.ReadVideoTitle(); }
public static void Main() { var kernel = new StandardKernel(); kernel.Load(Assembly.GetExecutingAssembly()); var fileReader = kernel.Get <IFileReader>(); var videoRepository = kernel.Get <IVideoRepository>(); var service = new VideoService(fileReader, videoRepository); var title = service.ReadVideoTitle(); }
public static void Main() { //var service = new VideoService(); //Dependency injection via method parameters //var title = service.ReadVideoTitle(new FileReader()); //Dependency injection via properties //var title = service.ReadVideoTitle(); //Dependency injection via constructor var service = new VideoService(new FileReader(), new VideoRepository()); var title = service.ReadVideoTitle(); }
public static void Main() { var service = new VideoService(); var title = service.ReadVideoTitle(); }
public static void Main() { var service = new VideoService(); //var title = service.ReadVideoTitle(new FileReader()); //DI by method parameter var title = service.ReadVideoTitle(); //DI by property }
public static void Main() { var service = new VideoService(); //var title = service.ReadVideoTitle(new FileReader()); // This is done through Dependency Injection Frameworks (for making objects for these...) var title = service.ReadVideoTitle(); }
public static void Main() { var service = new VideoService(); //var title = service.ReadVideoTitle(new FileReader()); var title = service.ReadVideoTitle(); }