using Microsoft.Extensions.Configuration;
using System.Collections.Generic;

namespace Bp.Sync.BackEnd
{
    public static class EasyNetQConfig
    {
        public static string GetConnecttionRabbitMq(IConfiguration configuration)
        {
            var connectString = new List<string>
            {
                $"host={configuration.GetSection("RabbitMqHosts").Value}",
                $"username={configuration.GetSection("RabbitMqUserName").Value}",
                $"password={configuration.GetSection("RabbitMqPassword").Value}",
                $"virtualhost={configuration.GetSection("RabbitMqVirtualHost").Value}",
                $"port={configuration.GetSection("RabbitMqPort").Value}",
                $"name={configuration.GetSection("RabbitMqName").Value}"
            };
            var rs = string.Join(";", connectString);
            return rs;
        }
    }
}
