From 12080aa71920d459c1b1764a90ceff37d151a7b6 Mon Sep 17 00:00:00 2001 From: Chukashev Oleg Date: Wed, 3 Apr 2024 18:54:39 +0300 Subject: [PATCH] Fix argument nre in CollectionIsNullOrEmptyError --- .../OperationErrors/CollectionIsNullOrEmptyError.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OperationResults/OperationErrors/CollectionIsNullOrEmptyError.cs b/OperationResults/OperationErrors/CollectionIsNullOrEmptyError.cs index c36f5bd..6ae563b 100644 --- a/OperationResults/OperationErrors/CollectionIsNullOrEmptyError.cs +++ b/OperationResults/OperationErrors/CollectionIsNullOrEmptyError.cs @@ -2,9 +2,9 @@ namespace OperationResults.OperationErrors { - public class CollectionIsNullOrEmptyError : OperationError + public class CollectionIsNullOrEmptyError : OperationError where TCollection : IEnumerable { private CollectionIsNullOrEmptyError(string message = null) : base(message) { } - public CollectionIsNullOrEmptyError(IEnumerable collection) : base($"Collection is null or empty. Collection type: {collection.GetType().FullName}") { } + public CollectionIsNullOrEmptyError(TCollection _, string argumentName = null) : base($"Collection {argumentName} of type {typeof(TCollection).FullName} is null or empty") { } } }