IsValid method for Argument class

Topics: Feature requests
Feb 7, 2013 at 6:44 AM
Edited Feb 7, 2013 at 6:47 AM
It will be usefull to have Argument.IsValid method. At our project we using value types for Id with bool operator overloading, so we cant use Argument.IsNotNull(). And now it looks strange when in code anyone see construction like Argument.IsSupported(BasketId, "Wrong BasketId");

Also will be good to have IsTrue() method.
Feb 7, 2013 at 8:05 AM
What kind of exceptions should the method throw?
  • InvalidOperation
  • ArgumentException
  • NotSupportedException
Feb 7, 2013 at 8:10 AM
Edited Feb 7, 2013 at 8:12 AM
I think for IsValid:

For IsTrue:

I'm not sure about IsTrue. I think ArgumentException would be better. It's generic check is argument ok or not.
Feb 7, 2013 at 8:07 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.