Rich Newman

MovieLister Class – .Net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MovieFinderTestSpring.Net
    public class MovieLister
        private static int lastVersionID = 0;
        private readonly int versionID;

        public int VersionID { get { return versionID; } }

        private IMovieFinder Finder { get; set; }

        public MovieLister(IMovieFinder finder)
            : this()
            this.Finder = finder;

        public MovieLister()
            this.versionID = ++MovieLister.lastVersionID;

        public Movie[] MoviesDirectedBy(String director)
            List<Movie> allMovies = Finder.FindAll();
            List<Movie> movies = new List<Movie>();
            foreach (Movie movie in allMovies)
                if (movie.Director == director)
            return movies.ToArray<Movie>();

Leave a Comment »

No comments yet.

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: