Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (38 sloc) 1.462 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
using System.Collections.Generic;

namespace SignalR
{
    /// <summary>
    /// Represents a result of
    /// </summary>
    public struct MessageResult
    {
        private static readonly List<Message> _emptyList = new List<Message>();

        /// <summary>
        /// Gets an <see cref="IList{Message}"/> associated with the result.
        /// </summary>
        public IList<Message> Messages { get; private set; }

        /// <summary>
        /// Gets a cursor representing the caller state.
        /// </summary>
        public string LastMessageId { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult"/> struc.
        /// </summary>
        /// <param name="lastMessageId">Gets a cursor representing the caller state.</param>
        public MessageResult(string lastMessageId)
            : this(_emptyList, lastMessageId)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageResult"/> struc.
        /// </summary>
        /// <param name="messages">The list of messages associated with this <see cref="MessageResult"/>.</param>
        /// <param name="lastMessageId">Gets a cursor representing the caller state.</param>
        public MessageResult(IList<Message> messages, string lastMessageId)
            : this()
        {
            Messages = messages;
            LastMessageId = lastMessageId;
        }
    }
}
Something went wrong with that request. Please try again.