In contrast to MSSQL, in MariaDB when working with MySqlConnector for .NET there is a way to specify multiple hostnames and the library itself knows how to do the loadbalancing and failover.
Host=host1:port1,host2:port2,Database=...,User=....,Password=....