public Movie(string title, MoviePerson director, int year, int rotTomScore, decimal imdbScore, List <string> actors) { Title = title; Director = director; Year = year; RotTomScore = rotTomScore; ImdbScore = imdbScore; Actors = actors; }
public override bool Equals(object obj) { MoviePerson other = obj as MoviePerson; if (other == null) { throw new ArgumentException("Argument of Equals must be of type MoviePerson"); } return(FirstName.Equals(other.FirstName) && LastName.Equals(other.LastName) && BirthDate.Equals(other.BirthDate)); }
public int CompareTo(object obj) { MoviePerson a = obj as MoviePerson; if (a == null) { throw new ArgumentException("CompareTo must get argument of type MoviePerson"); } else { int compare = lastName.CompareTo(a.lastName); if (compare == 0) { return(firstName.CompareTo(a.firstName)); } return(compare); } }