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") { } } }