[Mono-devel-list] Patch for System.Data.Common and System.Data.ProviderBase
Sureshkumar T
tsureshkumar at novell.com
Tue May 24 02:41:13 EDT 2005
> > + public override ParameterDirection Direction {
> > + get {
> > + if (_direction == ((ParameterDirection) 0)) {
> > + return ParameterDirection.Input;
> > + }
>
> what is this check for? revert to previous default assignment of
> ParameterDirection.Input.
>
> > + return _direction;
> > + }
> > + set {
> > + if (_direction != value) {
> > + switch (value) {
> > + case ParameterDirection.Input:
> > + case ParameterDirection.Output:
> > + case ParameterDirection.InputOutput:
> > + case ParameterDirection.ReturnValue:
> > + {
> > + PropertyChanging();
> > + _direction = value;
> > + return;
> > + }
> > + }
> > + throw ExceptionHelper.InvalidParameterDirection(value);
> > + }
> > +
>
> By the property declaration, this property cannot be set of any value
> other than of type ParameterDirection. These exception handling are
> irrelevant. Or am I missing something?
>
I was wrong. Any int value can be casted to this property. so the
exception handling is necessary.
Why not assigning ParameterDirection.Input by default to _direction
rather than checking with 0 and returning it back?
Thanks & Best Regards,
suresh.
More information about the Mono-devel-list
mailing list