using Domains;
namespace Infrastructure.Database
{
    /// Writes data to data storage
    ///  should be used to save changes
    public interface IWriter
    {
        /// Add  to data storage
        /// Entity to add
        /// Cancellation Token
        /// Entity type
        Task AddAsync(T entity, CancellationToken cancellationToken) where T : class, IEntity;
        /// Update  in data storage
        /// Entity to update
        /// Entity type
        void Update(T entity) where T : class, IEntity;
        /// Remove  from data storage
        /// Entity to remove
        /// Entity type
        void Remove(T entity) where T : class, IEntity;
    }
}