Пример #1
0
        /// <summary>
        /// Adds the info about the passed <see cref="ISportEvent"/> to the provided <see cref="StringBuilder"/>
        /// </summary>
        /// <param name="sportEvent">The <see cref="ISportEvent"/> containing data to display</param>
        /// <param name="builder">The <see cref="StringBuilder"/> to which to add the data</param>
        private void AddEntityData(ISportEvent sportEvent, StringBuilder builder)
        {
            Guard.Argument(sportEvent, nameof(sportEvent)).NotNull();
            Guard.Argument(builder, nameof(builder)).NotNull();

            var scheduled    = _taskProcessor.GetTaskResult(sportEvent.GetScheduledTimeAsync());
            var scheduledEnd = _taskProcessor.GetTaskResult(sportEvent.GetScheduledEndTimeAsync());
            var name         = _taskProcessor.GetTaskResult(sportEvent.GetNameAsync(_culture));
            var sportId      = _taskProcessor.GetTaskResult(sportEvent.GetSportIdAsync());

            builder.Append("Id=").Append(sportEvent.Id);
            builder.Append(" Name=").Append(name);
            builder.Append(" SportId=").Append(sportId);
            builder.Append(" Scheduled=").Append(scheduled?.ToShortDateString() ?? "null");
            builder.Append(" ScheduledEnd=").Append(scheduledEnd?.ToShortDateString() ?? "null");
        }
Пример #2
0
        /// <summary>
        /// Adds the info about the passed <see cref="ISportEvent"/> to the provided <see cref="StringBuilder"/>
        /// </summary>
        /// <param name="sportEvent">The <see cref="ISportEvent"/> containing data to display</param>
        /// <param name="builder">The <see cref="StringBuilder"/> to which to add the data</param>
        private void AddEntityData(ISportEvent sportEvent, StringBuilder builder)
        {
            Contract.Requires(sportEvent != null);
            Contract.Requires(builder != null);

            var scheduled    = _taskProcessor.GetTaskResult(sportEvent.GetScheduledTimeAsync());
            var scheduledEnd = _taskProcessor.GetTaskResult(sportEvent.GetScheduledEndTimeAsync());
            var name         = _taskProcessor.GetTaskResult(sportEvent.GetNameAsync(_culture));
            var sportId      = _taskProcessor.GetTaskResult(sportEvent.GetSportIdAsync());

            builder.Append("Id=").Append(sportEvent.Id);
            builder.Append(" Name=").Append(name);
            builder.Append(" SportId=").Append(sportId);
            builder.Append(" Scheduled=").Append(scheduled?.ToShortDateString() ?? "null");
            builder.Append(" ScheduledEnd=").Append(scheduledEnd?.ToShortDateString() ?? "null");
        }