public bool Equals(Seat seat) { return(seat != null && Coach.Equals(seat.Coach) && SeatNumber == seat.SeatNumber); }
public Seat(Coach coach, int seatNumber) { Coach = coach; SeatNumber = seatNumber; }
public static Train Of(List <Seat> seats) { List <Coach> coaches = seats.GroupBy(e => e.Coach).Select(grouping => Coach.Of(grouping.ToList())).ToList(); return(new Train(coaches)); }
public static Result WasSucces(Coach coach) { return(new Success(coach)); }
internal Success(Coach coach) => this.Coach = coach;
public override int GetHashCode() { return(Coach != null ? Coach.GetHashCode() : 0); }