You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Why do these two methods exist, wouldn't one be enough?
const int age = 16;
Guard.Against.InvalidInput(age, nameof(age), i => i >= 18, "To young!");
Guard.Against.AgainstExpression(i => i >= 18, age, "To young!");
If T is string I get the following error, is this intended?
const string name = "Joe";
Guard.Against.InvalidInput(name, nameof(name), i => i.StartsWith("S"), "The name does not start with 'S'"); //OK
Guard.Against.AgainstExpression(i => i.StartsWith("S"), name, "The name does not start with 'S'"); // ERROR
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have two questions:
1. Why do these two methods exist, wouldn't one be enough?
here is the screenshot:
Beta Was this translation helpful? Give feedback.
All reactions