using Microsoft.Data.SqlClient;

namespace Configuration
{
    public class SqlConnectionOptions
    {
        public required string ConnectionUrl { get; set; }
    }

    public class SqlConnectionFactory
    {
        private readonly string _connectionUrl;

        public SqlConnectionFactory(string connectionUrl)
        {
            _connectionUrl = connectionUrl;
        }

        public SqlConnection CreateSqlConnection()
        {
            SqlConnection conn = new SqlConnection(_connectionUrl);
            conn.Open();
            return conn;
        }
    }
}