|
1 | | -// Copyright (C) 2003-2010 Xtensive LLC. |
2 | | -// All rights reserved. |
3 | | -// For conditions of distribution and use, see license. |
| 1 | +// Copyright (C) 2009-2022 Xtensive LLC. |
| 2 | +// This code is distributed under MIT license terms. |
| 3 | +// See the License.txt file in the project root for more information. |
4 | 4 | // Created by: Denis Krjuchkov |
5 | 5 | // Created: 2009.08.24 |
6 | 6 |
|
@@ -28,11 +28,29 @@ public static bool IsNullReference(this SqlExpression expression) |
28 | 28 | return ReferenceEquals(expression, null); |
29 | 29 | } |
30 | 30 |
|
| 31 | + /// <summary> |
| 32 | + /// Checks whether <paramref name="available"/> contains all flags of given <paramref name="required"/>. |
| 33 | + /// </summary> |
| 34 | + /// <param name="available">All flags.</param> |
| 35 | + /// <param name="required">Flags to check existance.</param> |
| 36 | + /// <returns> |
| 37 | + /// <see langword="true"/> if <paramref name="available"/> contains all flags of <paramref name="required"/>, |
| 38 | + /// otherwise, <see langword="false"/>. |
| 39 | + /// </returns> |
31 | 40 | public static bool Supports(this SqlLockType available, SqlLockType required) |
32 | 41 | { |
33 | 42 | return (available & required)==required; |
34 | 43 | } |
35 | 44 |
|
| 45 | + /// <summary> |
| 46 | + /// Checks whether <paramref name="available"/> contains any flag of given <paramref name="required"/>. |
| 47 | + /// </summary> |
| 48 | + /// <param name="available">All flags.</param> |
| 49 | + /// <param name="required">Flags to check existance.</param> |
| 50 | + /// <returns> |
| 51 | + /// <see langword="true"/> if <paramref name="available"/> contains any flag of <paramref name="required"/>, |
| 52 | + /// otherwise, <see langword="false"/>. |
| 53 | + /// </returns> |
36 | 54 | public static bool SupportsAny(this SqlLockType available, SqlLockType required) |
37 | 55 | { |
38 | 56 | return (available | required) == required; |
|
0 commit comments