From 9cd90d3166600e881da3e4a7a71df38d78e84e85 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 12 Mar 2021 20:27:24 +0100 Subject: [PATCH] Tiny nullability corrections --- .../Infrastructure/RelationalOptionsExtension.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/EFCore.Relational/Infrastructure/RelationalOptionsExtension.cs b/src/EFCore.Relational/Infrastructure/RelationalOptionsExtension.cs index cd5b8422afc..add588a37ba 100644 --- a/src/EFCore.Relational/Infrastructure/RelationalOptionsExtension.cs +++ b/src/EFCore.Relational/Infrastructure/RelationalOptionsExtension.cs @@ -96,7 +96,7 @@ public virtual string? ConnectionString /// A new instance with the option changed. public virtual RelationalOptionsExtension WithConnectionString([CanBeNull] string? connectionString) { - Check.NotEmpty(connectionString, nameof(connectionString)); + Check.NullButNotEmpty(connectionString, nameof(connectionString)); var clone = Clone(); @@ -118,10 +118,8 @@ public virtual DbConnection? Connection /// /// The option to change. /// A new instance with the option changed. - public virtual RelationalOptionsExtension WithConnection([NotNull] DbConnection connection) + public virtual RelationalOptionsExtension WithConnection([CanBeNull] DbConnection? connection) { - Check.NotNull(connection, nameof(connection)); - var clone = Clone(); clone._connection = connection;