Skip to content

Commit 75834f4

Browse files
committed
Mark EnsureNotLocked() extension [Obsolete]
1 parent a2a8ce3 commit 75834f4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)