From 87d0dbd2e35f1f386a6cf137ea1eebf6f2a310b9 Mon Sep 17 00:00:00 2001 From: Bradley Grainger Date: Sat, 16 Dec 2023 08:38:37 -0800 Subject: [PATCH] Remove unnecessary precondition checks. The public constructors prevent the object from being in this state. Signed-off-by: Bradley Grainger --- src/HealthChecks.MySql/MySqlHealthCheck.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/HealthChecks.MySql/MySqlHealthCheck.cs b/src/HealthChecks.MySql/MySqlHealthCheck.cs index e12009cb2d..02b7530c0f 100644 --- a/src/HealthChecks.MySql/MySqlHealthCheck.cs +++ b/src/HealthChecks.MySql/MySqlHealthCheck.cs @@ -13,10 +13,6 @@ public class MySqlHealthCheck : IHealthCheck public MySqlHealthCheck(MySqlHealthCheckOptions options) { Guard.ThrowIfNull(options); - if (options.DataSource is null && options.ConnectionString is null) - throw new InvalidOperationException("One of options.DataSource or options.ConnectionString must be specified."); - if (options.DataSource is not null && options.ConnectionString is not null) - throw new InvalidOperationException("Only one of options.DataSource or options.ConnectionString must be specified."); _options = options; }