public static void Main() { var lister = new MovieLister(new ImdbMovieFinder()); lister.MoviesDirectedBy("Kubrick").Each( movie => Console.WriteLine(movie.ToString())); }
public static void Execute() { IMovieFinder xmlMovieFinder = new XmlMovieFinder("Movies.xml"); Movie[] spielbergMovies = new MovieLister(xmlMovieFinder).GetMoviesDirectedBy("Steven Spielberg"); spielbergMovies.PrintToConsole(); }
public static void Main() { ObjectFactory.Configure(cfg => { cfg.For<IMovieFinder>().Use<ImbdMovieFinder>(); }); var lister = new MovieLister( ObjectFactory.GetInstance<IMovieFinder>()); lister.MoviesDirectedBy("Kubrick").Each( movie => Console.WriteLine(movie.ToString())); }