diff --git a/src/Scrutor/ClosedTypeDecorationStrategy.cs b/src/Scrutor/ClosedTypeDecorationStrategy.cs index 06c5768..cb86a9d 100644 --- a/src/Scrutor/ClosedTypeDecorationStrategy.cs +++ b/src/Scrutor/ClosedTypeDecorationStrategy.cs @@ -28,6 +28,6 @@ public ClosedTypeDecorationStrategy(Type serviceType, Type? decoratorType, Func< return FactoryDecorator(serviceType, serviceKey, DecoratorFactory); } - throw new InvalidOperationException($"Both serviceType and decoratorFactory can not be null."); + throw new InvalidOperationException($"Both {nameof(DecoratorType)} and {nameof(DecoratorFactory)} can not be null."); } } diff --git a/src/Scrutor/OpenGenericDecorationStrategy.cs b/src/Scrutor/OpenGenericDecorationStrategy.cs index 62f014f..8d92855 100644 --- a/src/Scrutor/OpenGenericDecorationStrategy.cs +++ b/src/Scrutor/OpenGenericDecorationStrategy.cs @@ -35,6 +35,6 @@ public OpenGenericDecorationStrategy(Type serviceType, Type? decoratorType, Func return FactoryDecorator(serviceType, serviceKey, DecoratorFactory); } - throw new InvalidOperationException($"Both serviceType and decoratorFactory can not be null."); + throw new InvalidOperationException($"Both {nameof(DecoratorType)} and {nameof(DecoratorFactory)} can not be null."); } }