IsValid method for Argument class

Topics: Feature requests
Feb 7, 2013 at 5:44 AM
Edited Feb 7, 2013 at 5: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.
Coordinator
Feb 7, 2013 at 7:05 AM
What kind of exceptions should the method throw?
  • InvalidOperation
  • ArgumentException
  • NotSupportedException
Feb 7, 2013 at 7:10 AM
Edited Feb 7, 2013 at 7:12 AM
I think for IsValid:
•ArgumentException

For IsTrue:
•InvalidOperation

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