﻿// ***********************************************************************
// Project          : MoeActor
// Author           : Siqi Lu
// Created          : 2015-04-20  2:22 PM
//
// Last Modified By : Siqi Lu
// Last Modified On : 2015-04-20  5:01 PM
// ***********************************************************************
// <copyright file="IEventStore.cs" company="Shanghai Yuyi">
//     Copyright ©  2012-2015 Shanghai Yuyi. All rights reserved.
// </copyright>
// ***********************************************************************

using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Moe.Actor.Interface.Events
{
    /// <summary>
    ///     Interface IEventStore
    /// </summary>
    public interface IEventStore : IDictionary<Guid, IEventRecord>
    {
        /// <summary>
        ///     Gets the entity identifier.
        /// </summary>
        /// <value>The entity identifier.</value>
        Guid EntityId { get; }

        /// <summary>
        ///     Gets the sequential events.
        /// </summary>
        /// <returns>IList&lt;IEventRecord&gt;.</returns>
        IList<IEventRecord> GetSequentialEvents();

        /// <summary>
        ///     Stores the event record asynchronous.
        /// </summary>
        /// <param name="record">The record.</param>
        /// <returns>Task.</returns>
        Task StoreEventRecordAsync(IEventRecord record);

        /// <summary>
        ///     Stores the event asynchronous.
        /// </summary>
        /// <param name="event">The event.</param>
        /// <returns>Task.</returns>
        Task StoreEventAsync(IEvent @event);
    }
}
