/// <summary> /// Initializes a new instance of the <see cref="PitcherDTO"/> class /// </summary> /// <param name="record">A <see cref="pitcher"/> containing information about a pitcher</param> internal PitcherDTO(pitcher record) : base(record.id, record.name) { Guard.Argument(record, nameof(record)).NotNull(); Hand = record.hand.Equals("l", StringComparison.InvariantCultureIgnoreCase) ? PlayerHand.Left : PlayerHand.Right; Competitor = record.competitor.Equals("home", StringComparison.InvariantCultureIgnoreCase) ? HomeAway.Home : HomeAway.Away; }
/// <summary> /// Initializes a new instance of the <see cref="PitcherDTO"/> class /// </summary> /// <param name="record">A <see cref="pitcher"/> containing information about a pitcher</param> internal PitcherDTO(pitcher record) : base(record.id, record.name) { Contract.Requires(record != null); Hand = record.hand.Equals("l", StringComparison.InvariantCultureIgnoreCase) ? PlayerHand.Left : PlayerHand.Right; Competitor = record.competitor.Equals("home", StringComparison.InvariantCultureIgnoreCase) ? HomeAway.Home : HomeAway.Away; }