[Mono-devel-list] Clear in ConstraintCollection and KeyRestrictions in DbDataPermissionAttribute

Boris Kirzner borisk at mainsoft.com
Thu Mar 11 08:14:57 EST 2004

Regarding  ConstraintCollection.Clear() : 
MS documentation not says that Clear should raise an exception if 
CanRemove is violated and actually exception is not thrown.
So this part of implementation can stay as is.
But additional point is that MS documentation does not say that 
exception raised if you perform Remove that violates CanRemove,
but actually exception is thrown.
In our code exception is not thrown and the code has the following 
comment :
//LAMESPEC: spec doesn't document the ArgumentException the
//will be thrown if the CanRemove rule is violated

I think this one should be changed.


S Umadevi wrote:

>  I need help /thoughts on implementing the above.
>1. KeyRestriction in DbDataPermissionAttribute : The MSDN Documentation
>One or more connection string parameters that are allowed or
>Connection string parameters are identified in the form <parameter
>name>=. Multiple parameters can be specified, delimited using a
>semi-colon (;). The connection string parameters listed may be
>identified as either the only additional parameters allowed or
>additional parameters that are not allowed using the
>KeyRestrictionBehavior property.
>If no key restrictions are specified, and the KeyRestrictionBehavior
>property is set to AllowOnly, then no additional connection string
>parameters are allowed.
>If no key restrictions are specified, and the KeyRestrictionBehavior
>property is set to PreventUsage, then additional connection string
>parameters are allowed. If more than one rule is set for the same
>connection string, the more restrictive rule is selected during the
>permission check.
>When are these restrictions applied to the connection string for
>additional parameters ?. Since the connectionstring is a string how do
>we enforce  any additional parameters to it?  Or is that we dont want to
>allow additional agruements?
>Incase there are any examples of this usage please let me know..
>2. Clear method  in ConstraintCollection :
>The code has the following comment
>//LAMESPEC: MSFT implementation allows this
>>//even when a ForeignKeyConstraint exist for a UniqueConstraint
>>//thus violating the CanRemove logic
>But the MSDN documentation asks the user to check using  CanRemove. Now
>if we go by the assumption that the user will first check and then
>remove using clear method it seems to be fine..  But if we want to
>change this to check and remove only if there is no foreignkeyconstraint
>then, how do we indicate to the user that the clear didnt succeed ? The
>method does not throw any exception or return any value..
>Hence I feel we can stay with the existing implemenation.. Any other
>thoughts ?
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com

More information about the Mono-devel-list mailing list