using System.Collections.Generic;
using Consulenza.ReportWriter.Business.Entity;
using Consulenza.ReportWriter.Business;

namespace Consulenza.ReportWriter.Manager
{
    /// <summary>
    /// Classe Writer che invia una lista di EntityBase tramite un'istanza EnvironmentFacade esterna.
    /// </summary>
    public class WriterEntities
    {
        private readonly EnvironmentFacade _environmentFacade;

        /// <summary>
        /// Costruttore.
        /// </summary>
        /// <param name="environmentFacade"></param>
        public WriterEntities(EnvironmentFacade environmentFacade)
        {
            _environmentFacade = environmentFacade;
        }

        /// <summary>
        /// Renderizza la lista EntityBase.
        /// </summary>
        /// <param name="entities"></param>
        /// <returns>byte[]</returns>
        public byte[] RenderEntities(List<EntityBase> entities)
        {
            return _environmentFacade.RendererFacade.Render(entities);
        }

    }
}
