File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Orm/Xtensive.Orm/Core/Extensions Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (C) 2003-2010 Xtensive LLC.
2+ // All rights reserved.
3+ // For conditions of distribution and use, see license.
4+ // Created by: Alex Yakunin
5+ // Created: 2008.07.04
6+
7+ using System ;
8+
9+ namespace Xtensive . Core
10+ {
11+ /// <summary>
12+ /// <see cref="ILockable"/> related extension methods.
13+ /// </summary>
14+ public static class LockableExtensions
15+ {
16+ /// <summary>
17+ /// Ensures <paramref name="lockable"/> is not locked (see <see cref="ILockable.Lock()"/>) yet.
18+ /// </summary>
19+ /// <param name="lockable">Lockable object to check.</param>
20+ /// <exception cref="InstanceIsLockedException">Specified instance is locked.</exception>
21+ [ Obsolete ( "Use LockableBase.EnsureNotLocked method instead." ) ]
22+ public static void EnsureNotLocked ( this ILockable lockable )
23+ {
24+ ArgumentValidator . EnsureArgumentNotNull ( lockable , "lockable" ) ;
25+ if ( lockable . IsLocked )
26+ throw new InstanceIsLockedException ( Strings . ExInstanceIsLocked ) ;
27+ }
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments