using System.Data.Common;
using System.Text;

namespace Quadarax.Foundation.Core.Data.Extensions
{
    public class ConnectionStringHelper
    {
        private DbConnectionStringBuilder _builder;

        public ConnectionStringHelper(string connectionString)
        {
            _builder = new DbConnectionStringBuilder
            {
                ConnectionString = connectionString
            };
        }

        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append(_builder["Database"]);
            sb.Append("@");
            sb.Append(_builder["Server"]);
            return sb.ToString();
        }
    }
}
