From 2c08c6ab6f323eb1528c08a72d2fc7a8e08bd982 Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Wed, 4 May 2022 13:48:59 -0700 Subject: [PATCH 1/5] Optimizing refactoring: convert EnsureNotLocked() from extension to Method --- .../Collections/CollectionBaseSlim.cs | 8 +-- .../Collections/ExtensionCollection.cs | 4 +- .../Collections/FlagCollection.cs | 8 +-- Orm/Xtensive.Orm/Collections/TypeRegistry.cs | 10 +-- .../Core/Extensions/LockableExtensions.cs | 26 -------- Orm/Xtensive.Orm/Core/Interfaces/ILockable.cs | 8 +-- Orm/Xtensive.Orm/Core/LockableBase.cs | 42 ++++++------- .../Modelling/Actions/ActionSequence.cs | 4 +- .../Modelling/Actions/CreateNodeAction.cs | 8 +-- .../Modelling/Actions/DataAction.cs | 2 +- .../Modelling/Actions/GroupingNodeAction.cs | 4 +- .../Modelling/Actions/MoveNodeAction.cs | 8 +-- .../Modelling/Actions/NodeAction.cs | 4 +- Orm/Xtensive.Orm/Modelling/Node.cs | 20 +++--- Orm/Xtensive.Orm/Modelling/NodeCollection.cs | 12 ++-- .../Builders/DomainBuilderConfiguration.cs | 14 ++--- .../Orm/Building/Definitions/TypeDef.cs | 2 +- .../Building/Definitions/TypeDefCollection.cs | 2 +- .../Configuration/DatabaseConfiguration.cs | 6 +- .../Orm/Configuration/DomainConfiguration.cs | 62 +++++++++---------- .../Orm/Configuration/IgnoreRule.cs | 8 +-- .../KeyGeneratorConfiguration.cs | 8 +-- .../Configuration/LinqExtensionRegistry.cs | 4 +- .../Orm/Configuration/MappingRule.cs | 8 +-- .../Configuration/NameMappingCollection.cs | 6 +- .../Orm/Configuration/NamingConvention.cs | 8 +-- .../Orm/Configuration/NodeConfiguration.cs | 8 +-- .../Orm/Configuration/SessionConfiguration.cs | 24 +++---- .../SessionConfigurationCollection.cs | 2 +- .../Orm/Configuration/VersioningConvention.cs | 4 +- .../Orm/Internals/KeyGeneratorRegistry.cs | 4 +- .../MemberCompilerProvider.cs | 4 +- Orm/Xtensive.Orm/Orm/Model/AssociationInfo.cs | 12 ++-- Orm/Xtensive.Orm/Orm/Model/ColumnInfo.cs | 18 +++--- Orm/Xtensive.Orm/Orm/Model/FieldInfo.cs | 50 +++++++-------- Orm/Xtensive.Orm/Orm/Model/FieldMap.cs | 4 +- .../Orm/Model/FullTextIndexInfoCollection.cs | 2 +- Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs | 18 +++--- Orm/Xtensive.Orm/Orm/Model/KeyInfo.cs | 14 ++--- Orm/Xtensive.Orm/Orm/Model/MappedNode.cs | 2 +- Orm/Xtensive.Orm/Orm/Model/Node.cs | 4 +- Orm/Xtensive.Orm/Orm/Model/NodeCollection.cs | 6 +- .../Orm/Model/PartialIndexFilterInfo.cs | 4 +- .../Orm/Model/SchemaMappedNode.cs | 4 +- Orm/Xtensive.Orm/Orm/Model/SequenceInfo.cs | 4 +- .../Orm/Model/TypeDiscriminatorMap.cs | 6 +- Orm/Xtensive.Orm/Orm/Model/TypeIdRegistry.cs | 4 +- Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs | 16 ++--- .../Orm/Model/TypeInfoCollection.cs | 4 +- .../Orm/Providers/ModelMapping.cs | 10 +-- .../Internals/UpgradeServiceAccessor.cs | 22 +++---- Orm/Xtensive.Orm/Sql/Info/ColumnInfo.cs | 2 +- .../Info/Constaints/CheckConstraintInfo.cs | 4 +- .../Constaints/ForeignKeyConstraintInfo.cs | 4 +- .../Constaints/PrimaryKeyConstraintInfo.cs | 4 +- .../Info/Constaints/UniqueConstraintInfo.cs | 2 +- Orm/Xtensive.Orm/Sql/Info/CoreServerInfo.cs | 10 +-- .../Sql/Info/DataTypeCollection.cs | 2 +- Orm/Xtensive.Orm/Sql/Info/EntityInfo.cs | 4 +- .../Sql/Info/FullTextSearchInfo.cs | 2 +- Orm/Xtensive.Orm/Sql/Info/IdentityInfo.cs | 2 +- Orm/Xtensive.Orm/Sql/Info/IndexInfo.cs | 8 +-- Orm/Xtensive.Orm/Sql/Info/QueryInfo.cs | 12 ++-- Orm/Xtensive.Orm/Sql/Info/SequenceInfo.cs | 2 +- Orm/Xtensive.Orm/Sql/Info/TableInfo.cs | 4 +- .../Sql/Info/TemporaryTableInfo.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/Catalog.cs | 2 +- Orm/Xtensive.Orm/Sql/Model/CatalogNode.cs | 4 +- .../Sql/Model/Constraints/Constraint.cs | 10 +-- .../Sql/Model/Constraints/UniqueConstraint.cs | 2 +- Orm/Xtensive.Orm/Sql/Model/DataTableNode.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/Domain.cs | 6 +- Orm/Xtensive.Orm/Sql/Model/FullTextIndex.cs | 6 +- Orm/Xtensive.Orm/Sql/Model/Index.cs | 14 ++--- Orm/Xtensive.Orm/Sql/Model/IndexColumn.cs | 12 ++-- Orm/Xtensive.Orm/Sql/Model/Node.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/NodeCollection.cs | 2 +- .../Sql/Model/PairedNodeCollection.cs | 2 +- .../Sql/Model/Partitioning/Partition.cs | 4 +- .../Model/Partitioning/PartitionDescriptor.cs | 10 +-- .../Model/Partitioning/PartitionFunction.cs | 6 +- .../Sql/Model/Partitioning/PartitionSchema.cs | 2 +- .../Sql/Model/Partitioning/RangePartition.cs | 2 +- Orm/Xtensive.Orm/Sql/Model/Schema.cs | 2 +- Orm/Xtensive.Orm/Sql/Model/SchemaNode.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/Sequence.cs | 2 +- .../Sql/Model/SequenceDescriptor.cs | 14 ++--- Orm/Xtensive.Orm/Sql/Model/Table.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/TableColumn.cs | 16 ++--- Orm/Xtensive.Orm/Sql/Model/TemporaryTable.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/View.cs | 4 +- Orm/Xtensive.Orm/Sql/Model/ViewColumn.cs | 2 +- Orm/Xtensive.Orm/Sql/SqlExceptionInfo.cs | 12 ++-- 93 files changed, 368 insertions(+), 400 deletions(-) delete mode 100644 Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs diff --git a/Orm/Xtensive.Orm/Collections/CollectionBaseSlim.cs b/Orm/Xtensive.Orm/Collections/CollectionBaseSlim.cs index 83840a5eac..46f2e5922a 100644 --- a/Orm/Xtensive.Orm/Collections/CollectionBaseSlim.cs +++ b/Orm/Xtensive.Orm/Collections/CollectionBaseSlim.cs @@ -77,7 +77,7 @@ IEnumerator IEnumerable.GetEnumerator() /// public virtual void Add(TItem item) { - this.EnsureNotLocked(); + EnsureNotLocked(); items.Add(item); } @@ -88,21 +88,21 @@ public virtual void Add(TItem item) /// collection is null. public virtual void AddRange(IEnumerable collection) { - this.EnsureNotLocked(); + EnsureNotLocked(); items.AddRange(collection); } /// public virtual bool Remove(TItem item) { - this.EnsureNotLocked(); + EnsureNotLocked(); return items.Remove(item); } /// public virtual void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); items.Clear(); } diff --git a/Orm/Xtensive.Orm/Collections/ExtensionCollection.cs b/Orm/Xtensive.Orm/Collections/ExtensionCollection.cs index 12f7f39673..fe851865d1 100644 --- a/Orm/Xtensive.Orm/Collections/ExtensionCollection.cs +++ b/Orm/Xtensive.Orm/Collections/ExtensionCollection.cs @@ -67,7 +67,7 @@ public void Set(T value) /// Wrong arguments. public void Set(Type extensionType, object value) { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(extensionType, "extensionType"); if (extensionType.IsValueType) throw new ArgumentException(string.Format( @@ -87,7 +87,7 @@ public void Set(Type extensionType, object value) /// public void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); extensions = null; } diff --git a/Orm/Xtensive.Orm/Collections/FlagCollection.cs b/Orm/Xtensive.Orm/Collections/FlagCollection.cs index 83c0ae0543..4c0948f4de 100644 --- a/Orm/Xtensive.Orm/Collections/FlagCollection.cs +++ b/Orm/Xtensive.Orm/Collections/FlagCollection.cs @@ -72,7 +72,7 @@ public bool ContainsKey(TKey key) /// public void Add(TKey key, TFlag flag) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (keys.Contains(key)) throw new ArgumentException("key", Strings.ExCollectionAlreadyContainsSpecifiedItem); if (keys.Count >= MaxItemCount) @@ -91,7 +91,7 @@ public virtual void Add(TKey key) public bool Remove(TKey key) { ArgumentValidator.EnsureArgumentIsNotDefault(key, "key"); - this.EnsureNotLocked(); + EnsureNotLocked(); int index = keys.IndexOf(key); if (index < 0) return false; @@ -130,7 +130,7 @@ public TFlag this[TKey key] set { ArgumentValidator.EnsureArgumentIsNotDefault(key, "key"); - this.EnsureNotLocked(); + EnsureNotLocked(); int index = keys.IndexOf(key); if (index < 0) Add(key, value); @@ -191,7 +191,7 @@ public void Add(KeyValuePair item) /// public void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); keys.Clear(); flags = new BitVector32(0); } diff --git a/Orm/Xtensive.Orm/Collections/TypeRegistry.cs b/Orm/Xtensive.Orm/Collections/TypeRegistry.cs index b0fcd160e0..80c02cb435 100644 --- a/Orm/Xtensive.Orm/Collections/TypeRegistry.cs +++ b/Orm/Xtensive.Orm/Collections/TypeRegistry.cs @@ -57,7 +57,7 @@ public bool Contains(Type type) /// The type to register. public void Register(Type type) { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(type, "type"); if (!isProcessingPendingActions) Register(new TypeRegistration(type)); @@ -78,7 +78,7 @@ public void Register(Type type) /// When is null. public void Register(Assembly assembly) { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(assembly, "assembly"); Register(new TypeRegistration(assembly)); } @@ -95,7 +95,7 @@ public void Register(Assembly assembly) /// or is empty string. public void Register(Assembly assembly, string @namespace) { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(assembly, "assembly"); ArgumentValidator.EnsureArgumentNotNullOrEmpty(@namespace, "@namespace"); Register(new TypeRegistration(assembly, @namespace)); @@ -109,7 +109,7 @@ public void Register(Assembly assembly, string @namespace) /// otherwise, . public bool Register(TypeRegistration action) { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(action, "action"); if (actionSet.Contains(action)) return false; @@ -143,7 +143,7 @@ private void ProcessPendingActions() /// public override void Lock(bool recursive) { - this.EnsureNotLocked(); + EnsureNotLocked(); ProcessPendingActions(); assemblies = new ReadOnlyHashSet((HashSet)assemblies); base.Lock(recursive); diff --git a/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs b/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs deleted file mode 100644 index f1eae51344..0000000000 --- a/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2003-2010 Xtensive LLC. -// All rights reserved. -// For conditions of distribution and use, see license. -// Created by: Alex Yakunin -// Created: 2008.07.04 - -namespace Xtensive.Core -{ - /// - /// related extension methods. - /// - public static class LockableExtensions - { - /// - /// Ensures is not locked (see ) yet. - /// - /// Lockable object to check. - /// Specified instance is locked. - public static void EnsureNotLocked(this ILockable lockable) - { - ArgumentValidator.EnsureArgumentNotNull(lockable, "lockable"); - if (lockable.IsLocked) - throw new InstanceIsLockedException(Strings.ExInstanceIsLocked); - } - } -} \ No newline at end of file diff --git a/Orm/Xtensive.Orm/Core/Interfaces/ILockable.cs b/Orm/Xtensive.Orm/Core/Interfaces/ILockable.cs index 454ef3ac8f..172f92ef9f 100644 --- a/Orm/Xtensive.Orm/Core/Interfaces/ILockable.cs +++ b/Orm/Xtensive.Orm/Core/Interfaces/ILockable.cs @@ -1,6 +1,6 @@ -// Copyright (C) 2003-2010 Xtensive LLC. -// All rights reserved. -// For conditions of distribution and use, see license. +// Copyright (C) 2003-2022 Xtensive LLC. +// This code is distributed under MIT license terms. +// See the License.txt file in the project root for more information. namespace Xtensive.Core { @@ -23,7 +23,7 @@ public interface ILockable bool IsLocked { get; } /// - /// Locks the instance (non-recursively). + /// Locks the instance recursively. /// void Lock(); diff --git a/Orm/Xtensive.Orm/Core/LockableBase.cs b/Orm/Xtensive.Orm/Core/LockableBase.cs index 5064d51364..5709959fe3 100644 --- a/Orm/Xtensive.Orm/Core/LockableBase.cs +++ b/Orm/Xtensive.Orm/Core/LockableBase.cs @@ -1,6 +1,6 @@ -// Copyright (C) 2003-2010 Xtensive LLC. -// All rights reserved. -// For conditions of distribution and use, see license. +// Copyright (C) 2003-2022 Xtensive LLC. +// This code is distributed under MIT license terms. +// See the License.txt file in the project root for more information. // Created by: Alex Yakunin // Created: 2007.11.22 @@ -16,35 +16,29 @@ namespace Xtensive.Core [Serializable] public abstract class LockableBase: ILockable { - private bool isLocked; /// - public bool IsLocked + public bool IsLocked { [DebuggerStepThrough] get; private set; } + + /// + /// Ensures the object is not locked (see ) yet. + /// + /// Specified instance is locked. + public void EnsureNotLocked() { - [DebuggerStepThrough] - get { return isLocked; } + if (IsLocked) { + throw new InstanceIsLockedException(Strings.ExInstanceIsLocked); + } } + /// - public void Lock() - { - Lock(true); - } + public void Lock() => Lock(true); /// - public virtual void Lock(bool recursive) - { - isLocked = true; - } + public virtual void Lock(bool recursive) => + IsLocked = true; - /// - /// Unlocks the object. - /// Sets to . - /// - protected void Unlock() - { - isLocked = false; - } // Constructors @@ -63,7 +57,7 @@ protected LockableBase() /// Initial property value. protected LockableBase(bool isLocked) { - this.isLocked = isLocked; + IsLocked = isLocked; } } } \ No newline at end of file diff --git a/Orm/Xtensive.Orm/Modelling/Actions/ActionSequence.cs b/Orm/Xtensive.Orm/Modelling/Actions/ActionSequence.cs index 54301e96be..3fc6a70848 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/ActionSequence.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/ActionSequence.cs @@ -42,7 +42,7 @@ public ActionScope LogAction() public void Add(NodeAction action) { ArgumentValidator.EnsureArgumentNotNull(action, "action"); - this.EnsureNotLocked(); + EnsureNotLocked(); // Only locked actions can be added var ca = action as PropertyChangeAction; if (ca!=null && actions.Count!=0) { @@ -56,7 +56,7 @@ public void Add(NodeAction action) actions.RemoveAt(lastIndex); } } - action.Lock(true); + action.Lock(true); actions.Add(action); } diff --git a/Orm/Xtensive.Orm/Modelling/Actions/CreateNodeAction.cs b/Orm/Xtensive.Orm/Modelling/Actions/CreateNodeAction.cs index f79787c389..33ed0ae2c0 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/CreateNodeAction.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/CreateNodeAction.cs @@ -32,7 +32,7 @@ public Type Type { get { return type; } set { ArgumentValidator.EnsureArgumentNotNull(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); type = value; } } @@ -44,7 +44,7 @@ public string Name { get { return name; } set { ArgumentValidator.EnsureArgumentNotNullOrEmpty(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); name = value; } } @@ -56,7 +56,7 @@ public string Name { public int? Index { get { return index; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); index = value; } } @@ -71,7 +71,7 @@ public object[] Parameters { return parameters==null ? null : (object[]) parameters.Clone(); } set { - this.EnsureNotLocked(); + EnsureNotLocked(); parameters = value; } } diff --git a/Orm/Xtensive.Orm/Modelling/Actions/DataAction.cs b/Orm/Xtensive.Orm/Modelling/Actions/DataAction.cs index 1be2e1a0c7..e3e50cdcb7 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/DataAction.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/DataAction.cs @@ -26,7 +26,7 @@ public DataHint DataHint get { return dataHint; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); dataHint = value; Path = dataHint.SourceTablePath; } diff --git a/Orm/Xtensive.Orm/Modelling/Actions/GroupingNodeAction.cs b/Orm/Xtensive.Orm/Modelling/Actions/GroupingNodeAction.cs index 9237523e8d..a9143563f3 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/GroupingNodeAction.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/GroupingNodeAction.cs @@ -27,7 +27,7 @@ public class GroupingNodeAction : NodeAction public string Comment { get { return comment; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); comment = value; } } @@ -46,7 +46,7 @@ public IList Actions { public void Add(NodeAction action) { ArgumentValidator.EnsureArgumentNotNull(action, "action"); - this.EnsureNotLocked(); + EnsureNotLocked(); // Only locked actions can be added var ca = action as PropertyChangeAction; if (ca!=null && actions.Count!=0) { diff --git a/Orm/Xtensive.Orm/Modelling/Actions/MoveNodeAction.cs b/Orm/Xtensive.Orm/Modelling/Actions/MoveNodeAction.cs index fcc843f722..709f717643 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/MoveNodeAction.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/MoveNodeAction.cs @@ -31,7 +31,7 @@ public class MoveNodeAction : NodeAction public string Parent { get { return parent; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); parent = value; } } @@ -42,7 +42,7 @@ public string Parent { public string Name { get { return name; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); name = value; } } @@ -53,7 +53,7 @@ public string Name { public int? Index { get { return index; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); index = value; } } @@ -65,7 +65,7 @@ public int? Index { public string NewPath { get { return newPath; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); newPath = value; } } diff --git a/Orm/Xtensive.Orm/Modelling/Actions/NodeAction.cs b/Orm/Xtensive.Orm/Modelling/Actions/NodeAction.cs index 6f2d303368..4371188a22 100644 --- a/Orm/Xtensive.Orm/Modelling/Actions/NodeAction.cs +++ b/Orm/Xtensive.Orm/Modelling/Actions/NodeAction.cs @@ -30,7 +30,7 @@ public abstract class NodeAction : LockableBase, public string Path { get { return path; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); path = value; } } @@ -39,7 +39,7 @@ public string Path { public Difference Difference { get { return difference; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); difference = value; } } diff --git a/Orm/Xtensive.Orm/Modelling/Node.cs b/Orm/Xtensive.Orm/Modelling/Node.cs index 581c806617..7693fc8fb0 100644 --- a/Orm/Xtensive.Orm/Modelling/Node.cs +++ b/Orm/Xtensive.Orm/Modelling/Node.cs @@ -41,7 +41,7 @@ public abstract class Node : LockableBase, public static readonly char PathEscape = '\\'; [NonSerialized] - private static readonly ConcurrentDictionary> CachedPropertyAccessors = + private static readonly ConcurrentDictionary> CachedPropertyAccessors = new ConcurrentDictionary>(); [NonSerialized] private Node model; @@ -217,7 +217,7 @@ public void Move(Node newParent, string newName, int newIndex) throw new InvalidOperationException(Strings.ExInvalidNodeState); } - this.EnsureNotLocked(); + EnsureNotLocked(); if (newParent == Parent && newName == Name && newIndex == Index) { return; } @@ -342,7 +342,7 @@ public virtual Node Clone(Node newParent, string newName) } ArgumentValidator.EnsureArgumentNotNull(newName, nameof(newName)); - + // Cloning the instance var model = isModel ? null : (IModel) newParent.Model; Node node; @@ -397,9 +397,9 @@ protected virtual void CopyPropertyValue(Node target, PropertyAccessor accessor) else if (accessor.HasSetter) { var value = GetProperty(propertyName); if (value is IPathNode pathNode) { - CloningContext.Current.AddFixup(() => - accessor.Setter(target, - PathNodeReference.Resolve((IModel) target.Model, + CloningContext.Current.AddFixup(() => + accessor.Setter(target, + PathNodeReference.Resolve((IModel) target.Model, new PathNodeReference(pathNode.Path)))); return; } @@ -421,7 +421,7 @@ protected virtual void CopyPropertyValue(Node target, PropertyAccessor accessor) /// The new name. /// The new index. /// Item already exists. - /// is out of range, + /// is out of range, /// or belongs to a different . /// newName!=newIndex for . protected virtual void ValidateMove(Node newParent, string newName, int newIndex) @@ -628,7 +628,7 @@ protected virtual void PerformMove(Node newParent, string newName, int newIndex) } /// - /// Performs "shift" operation + /// Performs "shift" operation /// (induced by operation of another node). /// /// Shift offset. @@ -716,7 +716,7 @@ protected ActionScope LogPropertyChange(string propertyName, object propertyValu scope.Action = action; return scope; } - + /// /// Begins registration of a new action. /// @@ -778,7 +778,7 @@ protected void EnsureIsEditable() throw new InvalidOperationException(Strings.ExInvalidNodeState); } - this.EnsureNotLocked(); + EnsureNotLocked(); } #endregion diff --git a/Orm/Xtensive.Orm/Modelling/NodeCollection.cs b/Orm/Xtensive.Orm/Modelling/NodeCollection.cs index e26329238d..c7a1f55f73 100644 --- a/Orm/Xtensive.Orm/Modelling/NodeCollection.cs +++ b/Orm/Xtensive.Orm/Modelling/NodeCollection.cs @@ -165,7 +165,7 @@ public void Validate() /// public void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); var copy = list.ToArray(); for (int i = copy.Length - 1; i >= 0; i--) copy[i].Remove(); @@ -220,7 +220,7 @@ public override void Lock(bool recursive) /// Internal error. internal void Add(Node node) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (node.Index!=list.Count) throw Exceptions.InternalError("Wrong NodeCollection.Add arguments: node.Index!=list.Count!", CoreLog.Instance); string name = node.Name; @@ -245,7 +245,7 @@ internal void Add(Node node) /// Internal error. internal void Remove(Node node) { - this.EnsureNotLocked(); + EnsureNotLocked(); int count1 = list.Count; int count2 = nameIndex.Count; int index = node.Index; @@ -267,7 +267,7 @@ internal void Remove(Node node) internal void Move(Node node, int newIndex) { - this.EnsureNotLocked(); + EnsureNotLocked(); int count = list.Count; int oldIndex = node.Index; try { @@ -297,7 +297,7 @@ internal void Move(Node node, int newIndex) /// Internal error. internal void RemoveName(Node node) { - this.EnsureNotLocked(); + EnsureNotLocked(); string name = node.Name; if (nameIndex[name]!=node) throw Exceptions.InternalError("Wrong NodeCollection.RemoveName arguments: nameIndex[node.Name]!=node!", CoreLog.Instance); @@ -307,7 +307,7 @@ internal void RemoveName(Node node) /// Internal error. internal void AddName(Node node) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (!nameIndex.TryAdd(node.Name, node)) { throw Exceptions.InternalError("Wrong NodeCollection.AddName arguments: nameIndex[node.Name]!=null!", CoreLog.Instance); } diff --git a/Orm/Xtensive.Orm/Orm/Building/Builders/DomainBuilderConfiguration.cs b/Orm/Xtensive.Orm/Orm/Building/Builders/DomainBuilderConfiguration.cs index ec23ccfcea..129ec03d9b 100644 --- a/Orm/Xtensive.Orm/Orm/Building/Builders/DomainBuilderConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Building/Builders/DomainBuilderConfiguration.cs @@ -31,7 +31,7 @@ public DomainConfiguration DomainConfiguration get { return domainConfiguration; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); domainConfiguration = value; } } @@ -44,7 +44,7 @@ public UpgradeStage Stage get { return stage; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); stage = value; } } @@ -54,7 +54,7 @@ internal IModelFilter ModelFilter get { return modelFilter; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); modelFilter = value; } } @@ -64,7 +64,7 @@ internal UpgradeServiceAccessor Services get { return services; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); services = value; } } @@ -74,7 +74,7 @@ internal object UpgradeContextCookie get { return upgradeContextCookie; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); upgradeContextCookie = value; } } @@ -84,7 +84,7 @@ internal ICollection RecycledDefinitions get { return recycledDefinitions; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); recycledDefinitions = value; } } @@ -94,7 +94,7 @@ internal DefaultSchemaInfo DefaultSchemaInfo get { return defaultSchemaInfo; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultSchemaInfo = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDef.cs b/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDef.cs index c972ab53c8..1e8af2638f 100644 --- a/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDef.cs +++ b/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDef.cs @@ -51,7 +51,7 @@ public bool IsAbstract { get => (attributes & TypeAttributes.Abstract) > 0; internal set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | TypeAttributes.Abstract : Attributes & ~TypeAttributes.Abstract; diff --git a/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDefCollection.cs b/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDefCollection.cs index d90d76b13c..3bfa7433c9 100644 --- a/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDefCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Building/Definitions/TypeDefCollection.cs @@ -129,7 +129,7 @@ public override void Add(TypeDef item) { /// public override void AddRange(IEnumerable items) { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (var item in items) { Add(item); } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/DatabaseConfiguration.cs b/Orm/Xtensive.Orm/Orm/Configuration/DatabaseConfiguration.cs index 7911052dd5..15deb1db86 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/DatabaseConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/DatabaseConfiguration.cs @@ -29,7 +29,7 @@ public string Name set { ArgumentValidator.EnsureArgumentNotNullOrEmpty(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); name = value; } } @@ -44,7 +44,7 @@ public string RealName get { return realName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); realName = value; } } @@ -60,7 +60,7 @@ public int MinTypeId set { ArgumentValidator.EnsureArgumentIsGreaterThanOrEqual(value, TypeInfo.MinTypeId, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); minTypeId = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs b/Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs index 0605119a3c..5b31a80881 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/DomainConfiguration.cs @@ -149,7 +149,7 @@ public string Name get { return name; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(value, "value"); name = value; } @@ -170,7 +170,7 @@ public ConnectionInfo ConnectionInfo get { return connectionInfo; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionInfo = value; } } @@ -182,7 +182,7 @@ public string DefaultSchema { get { return defaultSchema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultSchema = value; } } @@ -195,7 +195,7 @@ public string DefaultDatabase { get { return defaultDatabase; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultDatabase = value; } } @@ -208,7 +208,7 @@ public DomainUpgradeMode UpgradeMode get { return upgradeMode; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); upgradeMode = value; } } @@ -238,7 +238,7 @@ public NamingConvention NamingConvention get { return namingConvention; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); namingConvention = value; } } @@ -252,7 +252,7 @@ public int KeyCacheSize get { return keyCacheSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentIsGreaterThan(value, 0, "value"); keyCacheSize = value; } @@ -267,7 +267,7 @@ public int KeyGeneratorCacheSize get { return keyGeneratorCacheSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentIsGreaterThan(value, 0, "value"); keyGeneratorCacheSize = value; } @@ -282,7 +282,7 @@ public int QueryCacheSize get { return queryCacheSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentIsGreaterThan(value, 0, "value"); queryCacheSize = value; } @@ -297,7 +297,7 @@ public int RecordSetMappingCacheSize get { return recordSetMappingCacheSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentIsGreaterThan(value, 0, "value"); recordSetMappingCacheSize = value; } @@ -312,7 +312,7 @@ public ForeignKeyMode ForeignKeyMode get { return foreignKeyMode; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); foreignKeyMode = value; } } @@ -326,7 +326,7 @@ public FullTextChangeTrackingMode FullTextChangeTrackingMode get { return fullTextChangeTrackingMode; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); fullTextChangeTrackingMode = value; } } @@ -342,7 +342,7 @@ public SchemaSyncExceptionFormat SchemaSyncExceptionFormat get { return schemaSyncExceptionFormat; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); schemaSyncExceptionFormat = value; } } @@ -356,7 +356,7 @@ public SessionConfigurationCollection Sessions set { ArgumentValidator.EnsureArgumentNotNull(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); sessions = value; } } @@ -370,7 +370,7 @@ public MappingRuleCollection MappingRules set { ArgumentValidator.EnsureArgumentNotNull(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); mappingRules = value; } } @@ -384,7 +384,7 @@ public DatabaseConfigurationCollection Databases set { ArgumentValidator.EnsureArgumentNotNull(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); databases = value; } } @@ -398,7 +398,7 @@ public KeyGeneratorConfigurationCollection KeyGenerators set { ArgumentValidator.EnsureArgumentNotNull(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); keyGenerators = value; } } @@ -410,7 +410,7 @@ public Type ServiceContainerType { get { return serviceContainerType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); serviceContainerType = value; } } @@ -424,7 +424,7 @@ public bool IncludeSqlInExceptions get { return includeSqlInExceptions; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); includeSqlInExceptions = value; } } @@ -439,7 +439,7 @@ public bool AllowCyclicDatabaseDependencies get { return allowCyclicDatabaseDependencies; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); allowCyclicDatabaseDependencies = value; } } @@ -455,7 +455,7 @@ public string ForcedServerVersion get { return forcedServerVersion; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); forcedServerVersion = value; } } @@ -469,7 +469,7 @@ public bool BuildInParallel get { return buildInParallel; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); buildInParallel = value; } } @@ -482,7 +482,7 @@ public IgnoreRuleCollection IgnoreRules get { return ignoreRules; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ignoreRules = value; } } @@ -504,7 +504,7 @@ public string Collation get { return collation; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); collation = value; } } @@ -519,7 +519,7 @@ public string ConnectionInitializationSql get { return connectionInitializationSql; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionInitializationSql = value; } } @@ -535,7 +535,7 @@ public bool MultidatabaseKeys get { return multidatabaseKeys; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); multidatabaseKeys = value; } } @@ -548,7 +548,7 @@ public DomainOptions Options get { return options; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); options = value; } } @@ -565,7 +565,7 @@ public bool ShareStorageSchemaOverNodes { get { return shareStorageSchemaOverNodes; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); shareStorageSchemaOverNodes = value; } } @@ -577,7 +577,7 @@ public VersioningConvention VersioningConvention { get { return versioningConvention; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); versioningConvention = value; } } @@ -589,7 +589,7 @@ public bool EnsureConnectionIsAlive { get { return ensureConnectionIsAlive; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ensureConnectionIsAlive = value; } } @@ -601,7 +601,7 @@ public TagsLocation TagsLocation { get => tagsLocation; set { - this.EnsureNotLocked(); + EnsureNotLocked(); tagsLocation = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/IgnoreRule.cs b/Orm/Xtensive.Orm/Orm/Configuration/IgnoreRule.cs index 066475c29c..f7a77afc79 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/IgnoreRule.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/IgnoreRule.cs @@ -30,7 +30,7 @@ public string Database get { return database; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); database = value; } } @@ -45,7 +45,7 @@ public string Schema get { return schema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); schema = value; } } @@ -61,7 +61,7 @@ public string Table get { return table; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); table = value; } } @@ -76,7 +76,7 @@ public string Column get { return column; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); column = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/KeyGeneratorConfiguration.cs b/Orm/Xtensive.Orm/Orm/Configuration/KeyGeneratorConfiguration.cs index a81e46bd13..e7fb4d1ca7 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/KeyGeneratorConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/KeyGeneratorConfiguration.cs @@ -27,7 +27,7 @@ public string Name set { ArgumentValidator.EnsureArgumentNotNullOrEmpty(value, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); name = value; } } @@ -40,7 +40,7 @@ public string Database get { return database; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); database = value; } } @@ -53,7 +53,7 @@ public long Seed get { return seed; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); seed = value; } } @@ -67,7 +67,7 @@ public long CacheSize set { ArgumentValidator.EnsureArgumentIsGreaterThan(value, 0, "value"); - this.EnsureNotLocked(); + EnsureNotLocked(); cacheSize = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/LinqExtensionRegistry.cs b/Orm/Xtensive.Orm/Orm/Configuration/LinqExtensionRegistry.cs index f8faf56acd..1c4d27c8d5 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/LinqExtensionRegistry.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/LinqExtensionRegistry.cs @@ -45,7 +45,7 @@ public IEnumerable Compilers /// Substitution public void Register(MemberInfo member, LambdaExpression substitution) { - this.EnsureNotLocked(); + EnsureNotLocked(); var registration = new LinqExtensionRegistration(member, substitution); registrations.Add(member, registration); } @@ -57,7 +57,7 @@ public void Register(MemberInfo member, LambdaExpression substitution) /// Compiler. public void Register(MemberInfo member, Func compiler) { - this.EnsureNotLocked(); + EnsureNotLocked(); var registration = new LinqExtensionRegistration(member, compiler); registrations.Add(member, registration); } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/MappingRule.cs b/Orm/Xtensive.Orm/Orm/Configuration/MappingRule.cs index 69f159e00a..21366b0f5a 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/MappingRule.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/MappingRule.cs @@ -29,7 +29,7 @@ public Assembly Assembly get { return assembly; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); assembly = value; } } @@ -44,7 +44,7 @@ public string Namespace get { return @namespace; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); @namespace = value; } } @@ -59,7 +59,7 @@ public string Database get { return database; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); database = value; } } @@ -74,7 +74,7 @@ public string Schema get { return schema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); schema = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/NameMappingCollection.cs b/Orm/Xtensive.Orm/Orm/Configuration/NameMappingCollection.cs index d092f245cd..12569674db 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/NameMappingCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/NameMappingCollection.cs @@ -40,7 +40,7 @@ public void Add([NotNull] string originalName, [NotNull] string mappedName) { ArgumentValidator.EnsureArgumentNotNullOrEmpty(originalName, "originalName"); ArgumentValidator.EnsureArgumentNotNullOrEmpty(mappedName, "mappedName"); - this.EnsureNotLocked(); + EnsureNotLocked(); items[originalName] = mappedName; } @@ -51,7 +51,7 @@ public void Add([NotNull] string originalName, [NotNull] string mappedName) public bool Remove([NotNull] string originalName) { ArgumentValidator.EnsureArgumentNotNullOrEmpty(originalName, "originalName"); - this.EnsureNotLocked(); + EnsureNotLocked(); return items.Remove(originalName); } @@ -73,7 +73,7 @@ public string Apply([NotNull] string name) /// public void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); items.Clear(); } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/NamingConvention.cs b/Orm/Xtensive.Orm/Orm/Configuration/NamingConvention.cs index 268c75232e..461b274273 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/NamingConvention.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/NamingConvention.cs @@ -31,7 +31,7 @@ public LetterCasePolicy LetterCasePolicy get { return letterCasePolicy; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); letterCasePolicy = value; } } @@ -44,7 +44,7 @@ public NamespacePolicy NamespacePolicy get { return namespacePolicy; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); namespacePolicy = value; } } @@ -57,7 +57,7 @@ public NamingRules NamingRules get { return namingRules; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); Validate(value, NamingRules.UnderscoreDots, NamingRules.RemoveDots); Validate(value, NamingRules.UnderscoreHyphens, NamingRules.RemoveHyphens); namingRules = value; @@ -94,7 +94,7 @@ public override void Lock(bool recursive) /// public object Clone() { - this.EnsureNotLocked(); + EnsureNotLocked(); var result = new NamingConvention(); result.letterCasePolicy = letterCasePolicy; result.namespacePolicy = namespacePolicy; diff --git a/Orm/Xtensive.Orm/Orm/Configuration/NodeConfiguration.cs b/Orm/Xtensive.Orm/Orm/Configuration/NodeConfiguration.cs index 15d2934f19..e18509b4d0 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/NodeConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/NodeConfiguration.cs @@ -30,7 +30,7 @@ public string NodeId get { return nodeId; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); nodeId = value; } } @@ -43,7 +43,7 @@ public DomainUpgradeMode UpgradeMode get { return upgradeMode; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); upgradeMode = value; } } @@ -56,7 +56,7 @@ public ConnectionInfo ConnectionInfo get { return connectionInfo; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionInfo = value; } } @@ -69,7 +69,7 @@ public string ConnectionInitializationSql get { return connectionInitializationSql; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionInitializationSql = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/SessionConfiguration.cs b/Orm/Xtensive.Orm/Orm/Configuration/SessionConfiguration.cs index d7d16d5c1d..1107f23c39 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/SessionConfiguration.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/SessionConfiguration.cs @@ -71,7 +71,7 @@ public class SessionConfiguration : ConfigurationBase public string UserName { get { return userName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); userName = value; } } @@ -83,7 +83,7 @@ public string UserName { public string Password { get { return password; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); password = value; } } @@ -95,7 +95,7 @@ public string Password { public int CacheSize { get { return cacheSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentIsGreaterThan(value, 1, "CacheSize"); cacheSize = value; } @@ -107,7 +107,7 @@ public int CacheSize { public SessionCacheType CacheType { get { return cacheType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); cacheType = value; } } @@ -119,7 +119,7 @@ public SessionCacheType CacheType { public IsolationLevel DefaultIsolationLevel { get { return defaultIsolationLevel; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultIsolationLevel = value; } } @@ -131,7 +131,7 @@ public IsolationLevel DefaultIsolationLevel { public int? DefaultCommandTimeout { get { return defaultCommandTimeout; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultCommandTimeout = value; } } @@ -149,7 +149,7 @@ public int? DefaultCommandTimeout { public int BatchSize { get { return batchSize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); batchSize = value; } } @@ -161,7 +161,7 @@ public int BatchSize { public SessionOptions Options { get { return options; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); options = value; } } @@ -173,7 +173,7 @@ public ReaderPreloadingPolicy ReaderPreloading { get { return readerPreloading; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); readerPreloading = value; } } @@ -185,7 +185,7 @@ public int EntityChangeRegistrySize { get { return entityChangeRegistrySize; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); entityChangeRegistrySize = value; } } @@ -196,7 +196,7 @@ public int EntityChangeRegistrySize public Type ServiceContainerType { get { return serviceContainerType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); serviceContainerType = value; } } @@ -207,7 +207,7 @@ public Type ServiceContainerType { public ConnectionInfo ConnectionInfo { get { return connectionInfo; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionInfo = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/SessionConfigurationCollection.cs b/Orm/Xtensive.Orm/Orm/Configuration/SessionConfigurationCollection.cs index 5518368d39..c260091e3a 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/SessionConfigurationCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/SessionConfigurationCollection.cs @@ -83,7 +83,7 @@ public override void Add(SessionConfiguration item) /// public override void AddRange(IEnumerable items) { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (var item in items) { Add(item); } diff --git a/Orm/Xtensive.Orm/Orm/Configuration/VersioningConvention.cs b/Orm/Xtensive.Orm/Orm/Configuration/VersioningConvention.cs index 85f4734dd0..41ecd5a681 100644 --- a/Orm/Xtensive.Orm/Orm/Configuration/VersioningConvention.cs +++ b/Orm/Xtensive.Orm/Orm/Configuration/VersioningConvention.cs @@ -25,7 +25,7 @@ public EntityVersioningPolicy EntityVersioningPolicy { get { return entityVersioningPolicy; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); entityVersioningPolicy = value; } } @@ -37,7 +37,7 @@ public bool DenyEntitySetOwnerVersionChange { get { return denyEntitySetOwnerVersionChange; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); denyEntitySetOwnerVersionChange = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Internals/KeyGeneratorRegistry.cs b/Orm/Xtensive.Orm/Orm/Internals/KeyGeneratorRegistry.cs index 624e5421d3..e6e4b39d26 100644 --- a/Orm/Xtensive.Orm/Orm/Internals/KeyGeneratorRegistry.cs +++ b/Orm/Xtensive.Orm/Orm/Internals/KeyGeneratorRegistry.cs @@ -42,13 +42,13 @@ public TemporaryKeyGenerator GetTemporary(KeyInfo key) public void Register(KeyInfo key, KeyGenerator generator) { - this.EnsureNotLocked(); + EnsureNotLocked(); generators.Add(key, generator); } public void RegisterTemporary(KeyInfo key, TemporaryKeyGenerator temporaryGenerator) { - this.EnsureNotLocked(); + EnsureNotLocked(); temporaryGenerators.Add(key, temporaryGenerator); } } diff --git a/Orm/Xtensive.Orm/Orm/Linq/MemberCompilation/MemberCompilerProvider.cs b/Orm/Xtensive.Orm/Orm/Linq/MemberCompilation/MemberCompilerProvider.cs index 275cec41da..0a40566afc 100644 --- a/Orm/Xtensive.Orm/Orm/Linq/MemberCompilation/MemberCompilerProvider.cs +++ b/Orm/Xtensive.Orm/Orm/Linq/MemberCompilation/MemberCompilerProvider.cs @@ -69,7 +69,7 @@ public void RegisterCompilers(Type compilerContainer) public void RegisterCompilers(Type compilerContainer, ConflictHandlingMethod conflictHandlingMethod) { ArgumentValidator.EnsureArgumentNotNull(compilerContainer, "compilerContainer"); - this.EnsureNotLocked(); + EnsureNotLocked(); if (compilerContainer.IsGenericType) throw new InvalidOperationException(string.Format( @@ -90,7 +90,7 @@ public void RegisterCompilers(IEnumerable>> compilerDefinitions, ConflictHandlingMethod conflictHandlingMethod) { ArgumentValidator.EnsureArgumentNotNull(compilerDefinitions, "compilerDefinitions"); - this.EnsureNotLocked(); + EnsureNotLocked(); var newItems = compilerDefinitions.Select(item => (item.Key, (Delegate) item.Value)); UpdateRegistry(newItems, conflictHandlingMethod); diff --git a/Orm/Xtensive.Orm/Orm/Model/AssociationInfo.cs b/Orm/Xtensive.Orm/Orm/Model/AssociationInfo.cs index a892b91cd5..e30f4cc7e5 100644 --- a/Orm/Xtensive.Orm/Orm/Model/AssociationInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/AssociationInfo.cs @@ -53,7 +53,7 @@ public TypeInfo AuxiliaryType get { return auxiliaryType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); auxiliaryType = value; } } @@ -84,7 +84,7 @@ public bool IsMaster get { return isMaster; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isMaster = value; } } @@ -132,7 +132,7 @@ public Multiplicity Multiplicity get { return multiplicity; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); multiplicity = value; } } @@ -145,7 +145,7 @@ public AssociationInfo Reversed get { return reversed; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); reversed = value; } } @@ -158,7 +158,7 @@ public OnRemoveAction? OnTargetRemove get { return onTargetRemove; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); onTargetRemove = value; } } @@ -171,7 +171,7 @@ public OnRemoveAction? OnOwnerRemove get { return onOwnerRemove; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); onOwnerRemove = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/ColumnInfo.cs b/Orm/Xtensive.Orm/Orm/Model/ColumnInfo.cs index efeac31133..b6fe08f6ff 100644 --- a/Orm/Xtensive.Orm/Orm/Model/ColumnInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/ColumnInfo.cs @@ -41,7 +41,7 @@ public bool IsSystem { get { return (attributes & ColumnAttributes.System) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? Attributes | ColumnAttributes.System : Attributes & ~ColumnAttributes.System; } } @@ -55,7 +55,7 @@ public bool IsDeclared get { return (attributes & ColumnAttributes.Declared) > 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? (attributes | ColumnAttributes.Declared) & ~ColumnAttributes.Inherited : attributes & ~ColumnAttributes.Declared | ColumnAttributes.Inherited; @@ -70,7 +70,7 @@ public bool IsInherited { get { return (attributes & ColumnAttributes.Inherited) > 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? (attributes | ColumnAttributes.Inherited) & ~ColumnAttributes.Declared : attributes & ~ColumnAttributes.Inherited | ColumnAttributes.Declared; @@ -85,7 +85,7 @@ public bool IsPrimaryKey { get { return (Attributes & ColumnAttributes.PrimaryKey) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? Attributes | ColumnAttributes.PrimaryKey : Attributes & ~ColumnAttributes.PrimaryKey; } } @@ -98,7 +98,7 @@ public bool IsNullable { get { return (attributes & ColumnAttributes.Nullable) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? Attributes | ColumnAttributes.Nullable : Attributes & ~ColumnAttributes.Nullable; } } @@ -111,7 +111,7 @@ public bool IsLazyLoad { get { return (attributes & ColumnAttributes.LazyLoad) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? Attributes | ColumnAttributes.LazyLoad : Attributes & ~ColumnAttributes.LazyLoad; } } @@ -126,7 +126,7 @@ public FieldInfo Field { get { return field; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); field = value; } } @@ -200,7 +200,7 @@ public CultureInfo CultureInfo { get { return cultureInfo; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); cultureInfo = value; } } @@ -213,7 +213,7 @@ public NodeCollection Indexes { get { return indexes; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); indexes = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/FieldInfo.cs b/Orm/Xtensive.Orm/Orm/Model/FieldInfo.cs index f015efc825..bbfec85764 100644 --- a/Orm/Xtensive.Orm/Orm/Model/FieldInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/FieldInfo.cs @@ -90,7 +90,7 @@ public bool IsSystem get { return (Attributes & FieldAttributes.System) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? (Attributes | FieldAttributes.System) : (Attributes & ~FieldAttributes.System); @@ -106,7 +106,7 @@ public bool SkipVersion get { return (Attributes & FieldAttributes.SkipVersion) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? (Attributes | FieldAttributes.SkipVersion) : (Attributes & ~FieldAttributes.SkipVersion); @@ -159,7 +159,7 @@ public bool IsDeclared get { return (Attributes & FieldAttributes.Declared) > 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? (Attributes | FieldAttributes.Declared) & ~FieldAttributes.Inherited : (Attributes & ~FieldAttributes.Declared) | FieldAttributes.Inherited; @@ -174,7 +174,7 @@ public bool IsEnum [DebuggerStepThrough] get { return (Attributes & FieldAttributes.Enum) > 0; } private set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? (Attributes | FieldAttributes.Enum) : (Attributes & ~FieldAttributes.Enum); @@ -190,7 +190,7 @@ public bool IsInherited get { return (Attributes & FieldAttributes.Inherited) > 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? (Attributes | FieldAttributes.Inherited) & ~FieldAttributes.Declared : (Attributes & ~FieldAttributes.Inherited) | FieldAttributes.Declared; @@ -206,7 +206,7 @@ public bool IsPrimaryKey get { return (Attributes & FieldAttributes.PrimaryKey) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | FieldAttributes.PrimaryKey : Attributes & ~FieldAttributes.PrimaryKey; if (column != null) column.IsPrimaryKey = true; @@ -234,7 +234,7 @@ public bool IsExplicit get { return (Attributes & FieldAttributes.Explicit) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | FieldAttributes.Explicit : Attributes & ~FieldAttributes.Explicit; } } @@ -248,7 +248,7 @@ public bool IsInterfaceImplementation get { return (Attributes & FieldAttributes.InterfaceImplementation) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | FieldAttributes.InterfaceImplementation : Attributes & ~FieldAttributes.InterfaceImplementation; } } @@ -298,7 +298,7 @@ public bool IsNullable get { return (Attributes & FieldAttributes.Nullable) != 0; } [DebuggerStepThrough] private set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | FieldAttributes.Nullable : Attributes & ~FieldAttributes.Nullable; } } @@ -312,7 +312,7 @@ public bool IsLazyLoad get { return (Attributes & FieldAttributes.LazyLoad) != 0; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); Attributes = value ? Attributes | FieldAttributes.LazyLoad : Attributes & ~FieldAttributes.LazyLoad; } } @@ -326,7 +326,7 @@ public string OriginalName { get { return originalName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ValidateName(value); originalName = value; } @@ -341,7 +341,7 @@ public Type ValueType get => valueType; [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); valueType = value; IsEnum = valueType.IsNullable() ? valueType.GetGenericArguments()[0].IsEnum @@ -358,7 +358,7 @@ public Type ItemType get { return itemType; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); itemType = value; } } @@ -372,7 +372,7 @@ public int? Length get { return length; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); length = value; } } @@ -386,7 +386,7 @@ public int? Scale get { return scale; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); scale = value; } } @@ -400,7 +400,7 @@ public int? Precision get { return precision; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); precision = value; } } @@ -415,7 +415,7 @@ public object DefaultValue get { return defaultValue; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultValue = value; } } @@ -431,7 +431,7 @@ public string DefaultSqlExpression get { return defaultSqlExpression; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultSqlExpression = value; } } @@ -455,7 +455,7 @@ public PropertyInfo UnderlyingProperty get { return underlyingProperty; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); underlyingProperty = value; } } @@ -477,7 +477,7 @@ public FieldInfo Parent get { return parent; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(value, "Parent"); parent = value; parent.Fields.Add(this); @@ -501,7 +501,7 @@ public TypeInfo ReflectedType get { return reflectedType; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); reflectedType = value; } } @@ -515,7 +515,7 @@ public TypeInfo DeclaringType get { return declaringType; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); declaringType = value; } } @@ -534,7 +534,7 @@ public ColumnInfo Column get { return column; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); column = value; } } @@ -573,7 +573,7 @@ public int AdapterIndex get { return adapterIndex; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); adapterIndex = value; } } @@ -586,7 +586,7 @@ public IList Validators { get { return validators; } internal set { - this.EnsureNotLocked(); + EnsureNotLocked(); validators = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/FieldMap.cs b/Orm/Xtensive.Orm/Orm/Model/FieldMap.cs index cb308e1311..3ee5f37c6a 100644 --- a/Orm/Xtensive.Orm/Orm/Model/FieldMap.cs +++ b/Orm/Xtensive.Orm/Orm/Model/FieldMap.cs @@ -48,7 +48,7 @@ public bool ContainsKey(FieldInfo interfaceField) public void Add(FieldInfo interfaceField, FieldInfo typeField) { - this.EnsureNotLocked(); + EnsureNotLocked(); map.Add(interfaceField, typeField); if (reversedMap.TryGetValue(typeField, out var interfaceFields)) { interfaceFields.Add(interfaceField); @@ -59,7 +59,7 @@ public void Add(FieldInfo interfaceField, FieldInfo typeField) public void Override(FieldInfo interfaceField, FieldInfo typeField) { - this.EnsureNotLocked(); + EnsureNotLocked(); var oldTypeField = map[interfaceField]; var interfaceFields = reversedMap[oldTypeField]; map[interfaceField] = typeField; diff --git a/Orm/Xtensive.Orm/Orm/Model/FullTextIndexInfoCollection.cs b/Orm/Xtensive.Orm/Orm/Model/FullTextIndexInfoCollection.cs index 8ff387f946..97af6944e8 100644 --- a/Orm/Xtensive.Orm/Orm/Model/FullTextIndexInfoCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Model/FullTextIndexInfoCollection.cs @@ -53,7 +53,7 @@ public bool TryGetValue(TypeInfo typeInfo, out FullTextIndexInfo fullTextIndexIn /// The full text index info. public void Add(TypeInfo typeInfo, FullTextIndexInfo fullTextIndexInfo) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (!container.Contains(fullTextIndexInfo)) container.Add(fullTextIndexInfo); indexMap.Add(typeInfo, fullTextIndexInfo); diff --git a/Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs b/Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs index c4062ef222..5156889784 100644 --- a/Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs @@ -54,7 +54,7 @@ public string ShortName { get { return shortName; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); shortName = value; } } @@ -64,7 +64,7 @@ public double FillFactor { get { return fillFactor; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); fillFactor = value; } } @@ -74,7 +74,7 @@ public ColumnGroup Group { get { return columnGroup; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); columnGroup = value; } } @@ -178,7 +178,7 @@ public IList FilterByTypes get { return filterByTypes; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); filterByTypes = value; } } @@ -191,7 +191,7 @@ public LambdaExpression FilterExpression { get { return filterExpression; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); filterExpression = value; } } @@ -206,7 +206,7 @@ public PartialIndexFilterInfo Filter { get { return filter; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); filter = value; } } @@ -219,7 +219,7 @@ public IList SelectColumns get { return selectColumns; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); selectColumns = value; } } @@ -229,7 +229,7 @@ public List>> ValueColumnsMap get { return valueColumnsMap; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); valueColumnsMap = value; } } @@ -279,7 +279,7 @@ public IndexAttributes Attributes get { return attributes; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/KeyInfo.cs b/Orm/Xtensive.Orm/Orm/Model/KeyInfo.cs index 3a10179b77..a3ef2a6fad 100644 --- a/Orm/Xtensive.Orm/Orm/Model/KeyInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/KeyInfo.cs @@ -45,7 +45,7 @@ public HierarchyInfo Hierarchy { get { return hierarchy; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); hierarchy = value; } } @@ -69,7 +69,7 @@ public string GeneratorName get { return generatorName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); generatorName = value; } } @@ -84,7 +84,7 @@ public string GeneratorBaseName get { return generatorBaseName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); generatorBaseName = value; } } @@ -97,7 +97,7 @@ public KeyGeneratorKind GeneratorKind get { return generatorKind; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); generatorKind = value; } } @@ -126,7 +126,7 @@ public KeyGeneratorKind GeneratorKind public SequenceInfo Sequence { get { return sequence; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); sequence = value; } } @@ -139,7 +139,7 @@ public bool IsFirstAmongSimilarKeys { get { return isFirstAmongSimilarKeys; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isFirstAmongSimilarKeys = value; } } @@ -155,7 +155,7 @@ public object EqualityIdentifier { get { return equalityIdentifier; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); equalityIdentifier = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/MappedNode.cs b/Orm/Xtensive.Orm/Orm/Model/MappedNode.cs index 66ab902be7..a3a75ddf5e 100644 --- a/Orm/Xtensive.Orm/Orm/Model/MappedNode.cs +++ b/Orm/Xtensive.Orm/Orm/Model/MappedNode.cs @@ -25,7 +25,7 @@ public string MappingName get { return mappingName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ValidateName(value); mappingName = value; } diff --git a/Orm/Xtensive.Orm/Orm/Model/Node.cs b/Orm/Xtensive.Orm/Orm/Model/Node.cs index 283e4cbadd..aad20f0b83 100644 --- a/Orm/Xtensive.Orm/Orm/Model/Node.cs +++ b/Orm/Xtensive.Orm/Orm/Model/Node.cs @@ -30,7 +30,7 @@ public string Name { get { return name; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ValidateName(value); ChangeState("Name", delegate { name = value; }); } @@ -86,7 +86,7 @@ public IExtensionCollection Extensions { /// public virtual void UpdateState() { - this.EnsureNotLocked(); + EnsureNotLocked(); } /// diff --git a/Orm/Xtensive.Orm/Orm/Model/NodeCollection.cs b/Orm/Xtensive.Orm/Orm/Model/NodeCollection.cs index 7270a9a7c2..2577948e94 100644 --- a/Orm/Xtensive.Orm/Orm/Model/NodeCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Model/NodeCollection.cs @@ -80,7 +80,7 @@ public override void Add(TNode item) /// public override void AddRange(IEnumerable nodes) { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (var node in nodes) { Add(node); } @@ -100,7 +100,7 @@ public override bool Remove(TNode item) /// public override void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach(var item in this) { TryUnsubscribe(item); } @@ -113,7 +113,7 @@ public virtual void UpdateState() { if (this==Empty) return; - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (TNode node in this) node.UpdateState(); } diff --git a/Orm/Xtensive.Orm/Orm/Model/PartialIndexFilterInfo.cs b/Orm/Xtensive.Orm/Orm/Model/PartialIndexFilterInfo.cs index bb452dd86d..2363000d84 100644 --- a/Orm/Xtensive.Orm/Orm/Model/PartialIndexFilterInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/PartialIndexFilterInfo.cs @@ -27,7 +27,7 @@ public LambdaExpression Expression get { return expression; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); expression = value; } } @@ -42,7 +42,7 @@ public IList Fields get { return fields; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); fields = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/SchemaMappedNode.cs b/Orm/Xtensive.Orm/Orm/Model/SchemaMappedNode.cs index cbb33295ad..dd4424799f 100644 --- a/Orm/Xtensive.Orm/Orm/Model/SchemaMappedNode.cs +++ b/Orm/Xtensive.Orm/Orm/Model/SchemaMappedNode.cs @@ -26,7 +26,7 @@ public string MappingDatabase get { return mappingDatabase; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); mappingDatabase = value; } } @@ -39,7 +39,7 @@ public string MappingSchema get { return mappingSchema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); mappingSchema = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/SequenceInfo.cs b/Orm/Xtensive.Orm/Orm/Model/SequenceInfo.cs index 19bace1fd5..5ac313f09e 100644 --- a/Orm/Xtensive.Orm/Orm/Model/SequenceInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/SequenceInfo.cs @@ -27,7 +27,7 @@ public long Seed { get { return seed; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); seed = value; } } @@ -40,7 +40,7 @@ public long Increment { get { return increment; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); increment = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/TypeDiscriminatorMap.cs b/Orm/Xtensive.Orm/Orm/Model/TypeDiscriminatorMap.cs index 4c2cf455b5..c789a14252 100644 --- a/Orm/Xtensive.Orm/Orm/Model/TypeDiscriminatorMap.cs +++ b/Orm/Xtensive.Orm/Orm/Model/TypeDiscriminatorMap.cs @@ -29,7 +29,7 @@ public FieldInfo Field get { return field; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (field != null) throw new InvalidOperationException(Strings.ExTypeDiscriminatorFieldIsAlreadySet); field = value; @@ -70,14 +70,14 @@ public object this[TypeInfo typeInfo] public void RegisterTypeMapping(TypeInfo type, object typeDiscriminatorValue) { - this.EnsureNotLocked(); + EnsureNotLocked(); map.Add(typeDiscriminatorValue, type); reversedMap.Add(type, typeDiscriminatorValue); } public void RegisterDefaultType(TypeInfo type) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (@default != null) throw new InvalidOperationException(Strings.ExDefaultTypeIsAlreadyRegistered); diff --git a/Orm/Xtensive.Orm/Orm/Model/TypeIdRegistry.cs b/Orm/Xtensive.Orm/Orm/Model/TypeIdRegistry.cs index 655e647f68..374dcb083e 100644 --- a/Orm/Xtensive.Orm/Orm/Model/TypeIdRegistry.cs +++ b/Orm/Xtensive.Orm/Orm/Model/TypeIdRegistry.cs @@ -97,7 +97,7 @@ public int GetTypeId(TypeInfo type) /// public void Clear() { - this.EnsureNotLocked(); + EnsureNotLocked(); mapping.Clear(); reverseMapping.Clear(); @@ -112,7 +112,7 @@ public void Clear() public void Register(int typeId, TypeInfo type) { ArgumentValidator.EnsureArgumentNotNull(type, "type"); - this.EnsureNotLocked(); + EnsureNotLocked(); mapping[type] = typeId; reverseMapping[typeId] = type; diff --git a/Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs b/Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs index d8b36adba6..c6ba9e470d 100644 --- a/Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs +++ b/Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs @@ -141,7 +141,7 @@ public bool IsOutboundOnly get { return isOutboundOnly; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isOutboundOnly = value; } } @@ -155,7 +155,7 @@ public bool IsInboundOnly get { return isInboundOnly; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isInboundOnly = value; } } @@ -168,7 +168,7 @@ public bool IsAuxiliary [DebuggerStepThrough] get { return (attributes & TypeAttributes.Auxiliary) == TypeAttributes.Auxiliary; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); attributes = value ? attributes | TypeAttributes.Auxiliary : attributes & ~TypeAttributes.Auxiliary; @@ -218,7 +218,7 @@ public Type UnderlyingType get { return underlyingType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); underlyingType = value; } } @@ -305,7 +305,7 @@ public HierarchyInfo Hierarchy [DebuggerStepThrough] get { return hierarchy; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); hierarchy = value; } } @@ -324,7 +324,7 @@ public KeyInfo Key public object TypeDiscriminatorValue { get { return typeDiscriminatorValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); typeDiscriminatorValue = value; } } @@ -362,7 +362,7 @@ public bool HasVersionRoots { get { return hasVersionRoots; } [DebuggerStepThrough] set { - this.EnsureNotLocked(); + EnsureNotLocked(); hasVersionRoots = value; } } @@ -387,7 +387,7 @@ public IList Validators get { return validators; } internal set { - this.EnsureNotLocked(); + EnsureNotLocked(); validators = value; } } diff --git a/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs b/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs index da5c913241..aec909e24a 100644 --- a/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs @@ -381,7 +381,7 @@ public ICollection Find(TypeAttributes criteria, MatchType matchType) /// The descendant. public void RegisterInheritance(TypeInfo ancestor, TypeInfo descendant) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (ancestor.IsInterface) { HashSet interfaces; @@ -409,7 +409,7 @@ public void RegisterInheritance(TypeInfo ancestor, TypeInfo descendant) /// The implementor. public void RegisterImplementation(TypeInfo @interface, TypeInfo implementor) { - this.EnsureNotLocked(); + EnsureNotLocked(); HashSet interfaces; if (!interfaceTable.TryGetValue(implementor, out interfaces)) { diff --git a/Orm/Xtensive.Orm/Orm/Providers/ModelMapping.cs b/Orm/Xtensive.Orm/Orm/Providers/ModelMapping.cs index 3c8c175944..4e3f660c7d 100644 --- a/Orm/Xtensive.Orm/Orm/Providers/ModelMapping.cs +++ b/Orm/Xtensive.Orm/Orm/Providers/ModelMapping.cs @@ -30,7 +30,7 @@ public string TemporaryTableDatabase get { return temporaryTableDatabase; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); temporaryTableDatabase = value; } } @@ -40,7 +40,7 @@ public string TemporaryTableSchema get { return temporaryTableSchema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); temporaryTableSchema = value; } } @@ -50,7 +50,7 @@ public string TemporaryTableCollation get { return temporaryTableCollation; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); temporaryTableCollation = value; } } @@ -77,13 +77,13 @@ public SchemaNode this[SequenceInfo sequenceInfo] public void Register(TypeInfo typeInfo, Table table) { - this.EnsureNotLocked(); + EnsureNotLocked(); tableMap[typeInfo] = table; } public void Register(SequenceInfo sequenceInfo, SchemaNode sequence) { - this.EnsureNotLocked(); + EnsureNotLocked(); sequenceMap[sequenceInfo] = sequence; } diff --git a/Orm/Xtensive.Orm/Orm/Upgrade/Internals/UpgradeServiceAccessor.cs b/Orm/Xtensive.Orm/Orm/Upgrade/Internals/UpgradeServiceAccessor.cs index 4bf9d5e013..5eb3ae1000 100644 --- a/Orm/Xtensive.Orm/Orm/Upgrade/Internals/UpgradeServiceAccessor.cs +++ b/Orm/Xtensive.Orm/Orm/Upgrade/Internals/UpgradeServiceAccessor.cs @@ -39,7 +39,7 @@ public DomainConfiguration Configuration get { return configuration; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); configuration = value; } } @@ -49,7 +49,7 @@ public HandlerFactory HandlerFactory get { return handlerFactory; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); handlerFactory = value; } } @@ -59,7 +59,7 @@ public StorageDriver StorageDriver get { return storageDriver; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); storageDriver = value; } } @@ -71,7 +71,7 @@ public NameBuilder NameBuilder get { return nameBuilder; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); nameBuilder = value; } } @@ -81,7 +81,7 @@ public MappingResolver MappingResolver get { return mappingResolver; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); mappingResolver = value; } } @@ -91,7 +91,7 @@ public PartialIndexFilterCompiler IndexFilterCompiler get { return indexFilterCompiler; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); indexFilterCompiler = value; } } @@ -101,7 +101,7 @@ public IReadOnlyList Modules get { return modules; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); modules = value; } } @@ -111,7 +111,7 @@ public IReadOnlyList OrderedUpgradeHandlers get { return orderedUpgradeHandlers; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); orderedUpgradeHandlers = value; } } @@ -121,7 +121,7 @@ public IReadOnlyDictionary UpgradeHandlers get { return upgradeHandlers; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); upgradeHandlers = value; } } @@ -131,7 +131,7 @@ public IFullTextCatalogNameBuilder FulltextCatalogNameBuilder get { return catalogNameBuilder; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); catalogNameBuilder = value; } } @@ -141,7 +141,7 @@ public SqlConnection Connection get { return connection; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connection = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/ColumnInfo.cs b/Orm/Xtensive.Orm/Sql/Info/ColumnInfo.cs index 8f518c77aa..00a4d28312 100644 --- a/Orm/Xtensive.Orm/Sql/Info/ColumnInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/ColumnInfo.cs @@ -21,7 +21,7 @@ public class ColumnInfo : EntityInfo public ColumnFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/Constaints/CheckConstraintInfo.cs b/Orm/Xtensive.Orm/Sql/Info/Constaints/CheckConstraintInfo.cs index fc2821e5a8..58ca7b7917 100644 --- a/Orm/Xtensive.Orm/Sql/Info/Constaints/CheckConstraintInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/Constaints/CheckConstraintInfo.cs @@ -22,7 +22,7 @@ public class CheckConstraintInfo : EntityInfo public CheckConstraintFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } @@ -34,7 +34,7 @@ public CheckConstraintFeatures Features { public int MaxExpressionLength { get { return maxExpressionLength; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxExpressionLength = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/Constaints/ForeignKeyConstraintInfo.cs b/Orm/Xtensive.Orm/Sql/Info/Constaints/ForeignKeyConstraintInfo.cs index a8f6fa5737..127127e97a 100644 --- a/Orm/Xtensive.Orm/Sql/Info/Constaints/ForeignKeyConstraintInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/Constaints/ForeignKeyConstraintInfo.cs @@ -22,7 +22,7 @@ public class ForeignKeyConstraintInfo : EntityInfo public ForeignKeyConstraintFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } @@ -34,7 +34,7 @@ public ForeignKeyConstraintFeatures Features { public ForeignKeyConstraintActions Actions { get { return actions; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); actions = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/Constaints/PrimaryKeyConstraintInfo.cs b/Orm/Xtensive.Orm/Sql/Info/Constaints/PrimaryKeyConstraintInfo.cs index 82b9d7525b..3355e207d5 100644 --- a/Orm/Xtensive.Orm/Sql/Info/Constaints/PrimaryKeyConstraintInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/Constaints/PrimaryKeyConstraintInfo.cs @@ -26,7 +26,7 @@ public string ConstantName { get { return constantName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); constantName = value; } } @@ -38,7 +38,7 @@ public string ConstantName public PrimaryKeyConstraintFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/Constaints/UniqueConstraintInfo.cs b/Orm/Xtensive.Orm/Sql/Info/Constaints/UniqueConstraintInfo.cs index 76041a8836..e1969ec062 100644 --- a/Orm/Xtensive.Orm/Sql/Info/Constaints/UniqueConstraintInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/Constaints/UniqueConstraintInfo.cs @@ -22,7 +22,7 @@ public class UniqueConstraintInfo : EntityInfo public UniqueConstraintFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/CoreServerInfo.cs b/Orm/Xtensive.Orm/Sql/Info/CoreServerInfo.cs index 7ad3354aa7..b08f385018 100644 --- a/Orm/Xtensive.Orm/Sql/Info/CoreServerInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/CoreServerInfo.cs @@ -28,7 +28,7 @@ public Version ServerVersion { return serverVersion; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); serverVersion = value; } } @@ -41,7 +41,7 @@ public string ConnectionString { return connectionString; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); connectionString = value; } } @@ -54,7 +54,7 @@ public string DatabaseName { return databaseName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); databaseName = value; } } @@ -67,7 +67,7 @@ public string DefaultSchemaName { return defaultSchemaName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultSchemaName = value; } } @@ -80,7 +80,7 @@ public bool MultipleActiveResultSets { return multipleActiveResultSets; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); multipleActiveResultSets = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/DataTypeCollection.cs b/Orm/Xtensive.Orm/Sql/Info/DataTypeCollection.cs index 6209cb8d52..101e121a0d 100644 --- a/Orm/Xtensive.Orm/Sql/Info/DataTypeCollection.cs +++ b/Orm/Xtensive.Orm/Sql/Info/DataTypeCollection.cs @@ -56,7 +56,7 @@ public DataTypeInfo this[SqlType sqlType] /// The dataTypeInfo to add. public void Add(SqlType sqlType, DataTypeInfo dataTypeInfo) { - this.EnsureNotLocked(); + EnsureNotLocked(); if (!IsLocked) sqlTypes.Add(sqlType, dataTypeInfo); } diff --git a/Orm/Xtensive.Orm/Sql/Info/EntityInfo.cs b/Orm/Xtensive.Orm/Sql/Info/EntityInfo.cs index 3b7afd2e19..2cc74f3c47 100644 --- a/Orm/Xtensive.Orm/Sql/Info/EntityInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/EntityInfo.cs @@ -22,7 +22,7 @@ public int MaxIdentifierLength get { return maxIdentifierLength; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxIdentifierLength = value; } } @@ -36,7 +36,7 @@ public DdlStatements AllowedDdlStatements get { return allowedDdlStatements; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); allowedDdlStatements = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/FullTextSearchInfo.cs b/Orm/Xtensive.Orm/Sql/Info/FullTextSearchInfo.cs index c7dca694ed..c3d1b52a6e 100644 --- a/Orm/Xtensive.Orm/Sql/Info/FullTextSearchInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/FullTextSearchInfo.cs @@ -21,7 +21,7 @@ public class FullTextSearchInfo : EntityInfo public FullTextSearchFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/IdentityInfo.cs b/Orm/Xtensive.Orm/Sql/Info/IdentityInfo.cs index 9efdb78701..6db586dc41 100644 --- a/Orm/Xtensive.Orm/Sql/Info/IdentityInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/IdentityInfo.cs @@ -20,7 +20,7 @@ public class IdentityInfo : LockableBase public IdentityFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/IndexInfo.cs b/Orm/Xtensive.Orm/Sql/Info/IndexInfo.cs index 4baf0e1ddb..6a9e1c3304 100644 --- a/Orm/Xtensive.Orm/Sql/Info/IndexInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/IndexInfo.cs @@ -23,7 +23,7 @@ public class IndexInfo : EntityInfo public int MaxLength { get { return maxLength; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxLength = value; } } @@ -34,7 +34,7 @@ public int MaxLength { public int MaxNumberOfColumns { get { return maxNumberOfColumns; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxNumberOfColumns = value; } } @@ -45,7 +45,7 @@ public int MaxNumberOfColumns { public PartitionMethods PartitionMethods { get { return partitionMethods; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionMethods = value; } } @@ -57,7 +57,7 @@ public PartitionMethods PartitionMethods { public IndexFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/QueryInfo.cs b/Orm/Xtensive.Orm/Sql/Info/QueryInfo.cs index 78231ec42f..143253c7fa 100644 --- a/Orm/Xtensive.Orm/Sql/Info/QueryInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/QueryInfo.cs @@ -26,7 +26,7 @@ public int MaxLength { get => maxLength; set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxLength = value; } } @@ -38,7 +38,7 @@ public int MaxComparisonOperations { get => maxComparisonOperations; set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxComparisonOperations = value; } } @@ -50,7 +50,7 @@ public int MaxNestedSubqueriesAmount { get => maxNestedQueriesAmount; set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxNestedQueriesAmount = value; } } @@ -62,7 +62,7 @@ public string ParameterPrefix { get => parameterPrefix; set { - this.EnsureNotLocked(); + EnsureNotLocked(); parameterPrefix = value; } } @@ -75,7 +75,7 @@ public QueryFeatures Features { get => features; set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } @@ -87,7 +87,7 @@ public int MaxQueryParameterCount { get => maxQueryParameterCount; set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxQueryParameterCount = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/SequenceInfo.cs b/Orm/Xtensive.Orm/Sql/Info/SequenceInfo.cs index 8a658be099..aab12fe5f0 100644 --- a/Orm/Xtensive.Orm/Sql/Info/SequenceInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/SequenceInfo.cs @@ -23,7 +23,7 @@ public SequenceFeatures Features get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/TableInfo.cs b/Orm/Xtensive.Orm/Sql/Info/TableInfo.cs index 44b8dd165c..bb521b3e19 100644 --- a/Orm/Xtensive.Orm/Sql/Info/TableInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/TableInfo.cs @@ -21,7 +21,7 @@ public class TableInfo : EntityInfo public PartitionMethods PartitionMethods { get { return partitionMethods; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionMethods = value; } } @@ -32,7 +32,7 @@ public PartitionMethods PartitionMethods { public int MaxNumberOfColumns { get { return maxNumberOfColumns; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxNumberOfColumns = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Info/TemporaryTableInfo.cs b/Orm/Xtensive.Orm/Sql/Info/TemporaryTableInfo.cs index cea045af24..3a332a5b51 100644 --- a/Orm/Xtensive.Orm/Sql/Info/TemporaryTableInfo.cs +++ b/Orm/Xtensive.Orm/Sql/Info/TemporaryTableInfo.cs @@ -22,7 +22,7 @@ public class TemporaryTableInfo : EntityInfo public TemporaryTableFeatures Features { get { return features; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); features = value; } } @@ -33,7 +33,7 @@ public TemporaryTableFeatures Features { public int MaxNumberOfColumns { get { return maxNumberOfColumns; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxNumberOfColumns = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Catalog.cs b/Orm/Xtensive.Orm/Sql/Model/Catalog.cs index af76afb8b8..ac813e14a1 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Catalog.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Catalog.cs @@ -100,7 +100,7 @@ public Schema DefaultSchema return null; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (defaultSchema == value) return; if (value!=null && !schemas.Contains(value)) diff --git a/Orm/Xtensive.Orm/Sql/Model/CatalogNode.cs b/Orm/Xtensive.Orm/Sql/Model/CatalogNode.cs index 04676f074a..f6afe9798b 100644 --- a/Orm/Xtensive.Orm/Sql/Model/CatalogNode.cs +++ b/Orm/Xtensive.Orm/Sql/Model/CatalogNode.cs @@ -57,7 +57,7 @@ public Catalog Catalog { get { return catalog; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (catalog != value) ChangeCatalog(value); } @@ -78,7 +78,7 @@ public Catalog Catalog /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, Catalog value) { - this.EnsureNotLocked(); + EnsureNotLocked(); catalog = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Constraints/Constraint.cs b/Orm/Xtensive.Orm/Sql/Model/Constraints/Constraint.cs index 8c5d3c6ab7..4723e2dca7 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Constraints/Constraint.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Constraints/Constraint.cs @@ -27,7 +27,7 @@ public bool? IsDeferrable get { return isDeferrable; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isDeferrable = value; } } @@ -41,7 +41,7 @@ public bool? IsInitiallyDeferred get { return isInitiallyDeferred; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isInitiallyDeferred = value; } } @@ -55,7 +55,7 @@ public SqlExpression Condition get { return condition; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); condition = value; } } @@ -89,7 +89,7 @@ public T Owner get { return owner; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ChangeOwner(value); } } @@ -109,7 +109,7 @@ public T Owner /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, T value) { - this.EnsureNotLocked(); + EnsureNotLocked(); owner = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Constraints/UniqueConstraint.cs b/Orm/Xtensive.Orm/Sql/Model/Constraints/UniqueConstraint.cs index 49d97f259a..bbaabde174 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Constraints/UniqueConstraint.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Constraints/UniqueConstraint.cs @@ -21,7 +21,7 @@ public class UniqueConstraint : TableConstraint public bool IsClustered { get { return isClustered; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isClustered = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/DataTableNode.cs b/Orm/Xtensive.Orm/Sql/Model/DataTableNode.cs index 61c29297d8..f2989807f5 100644 --- a/Orm/Xtensive.Orm/Sql/Model/DataTableNode.cs +++ b/Orm/Xtensive.Orm/Sql/Model/DataTableNode.cs @@ -23,7 +23,7 @@ public DataTable DataTable { get { return dataTable; } protected set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (dataTable != value) { ChangeDataTable(value); } @@ -46,7 +46,7 @@ protected set { /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, DataTable value) { - this.EnsureNotLocked(); + EnsureNotLocked(); dataTable = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Domain.cs b/Orm/Xtensive.Orm/Sql/Model/Domain.cs index 81e1af2c43..660cf1f1d4 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Domain.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Domain.cs @@ -42,7 +42,7 @@ public SqlValueType DataType get { return dataType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); dataType = value; } } @@ -56,7 +56,7 @@ public SqlExpression DefaultValue get { return defaultValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultValue = value; } } @@ -70,7 +70,7 @@ public Collation Collation get { return collation; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); collation = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/FullTextIndex.cs b/Orm/Xtensive.Orm/Sql/Model/FullTextIndex.cs index e0522a625b..4cc843da5a 100644 --- a/Orm/Xtensive.Orm/Sql/Model/FullTextIndex.cs +++ b/Orm/Xtensive.Orm/Sql/Model/FullTextIndex.cs @@ -30,7 +30,7 @@ public string FullTextCatalog get { return fullTextCatalog; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); fullTextCatalog = value; } } @@ -43,7 +43,7 @@ public ChangeTrackingMode ChangeTrackingMode get { return changeTrackingMode; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); changeTrackingMode = value; } } @@ -56,7 +56,7 @@ public string UnderlyingUniqueIndex get { return underlyingUniqueIndex; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); underlyingUniqueIndex = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Index.cs b/Orm/Xtensive.Orm/Sql/Model/Index.cs index 4dcaf364dc..1ebdf9a7f1 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Index.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Index.cs @@ -92,7 +92,7 @@ public SqlExpression Where get { return where; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); where = value; } } @@ -106,7 +106,7 @@ public bool IsUnique get { return isUnique; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isUnique = value; } } @@ -137,7 +137,7 @@ public bool IsBitmap get { return isBitmap; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isBitmap = value; } } @@ -154,7 +154,7 @@ public bool IsClustered get { return isClustered; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isClustered = value; } } @@ -168,7 +168,7 @@ public byte? FillFactor get { return fillFactor; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); fillFactor = value; } } @@ -183,7 +183,7 @@ public string Filegroup get { return filegroup; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); filegroup = value; } } @@ -196,7 +196,7 @@ public PartitionDescriptor PartitionDescriptor { get { return partitionDescriptor; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); PartitionDescriptor old = partitionDescriptor; partitionDescriptor = value; if (old!=null && old.Owner==this) diff --git a/Orm/Xtensive.Orm/Sql/Model/IndexColumn.cs b/Orm/Xtensive.Orm/Sql/Model/IndexColumn.cs index 303184a2df..f34abc3ca8 100644 --- a/Orm/Xtensive.Orm/Sql/Model/IndexColumn.cs +++ b/Orm/Xtensive.Orm/Sql/Model/IndexColumn.cs @@ -29,7 +29,7 @@ public Index Index { get { return index; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (index == value) return; if (index!=null) @@ -49,7 +49,7 @@ public DataTableColumn Column get { return column; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); column = value; } } @@ -62,7 +62,7 @@ public DataTableColumn TypeColumn get { return typeColumn; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); typeColumn = value; } } @@ -79,7 +79,7 @@ public bool Ascending get { return ascending; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ascending = value; } } @@ -102,7 +102,7 @@ public SqlExpression Expression get { return expression; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); expression = value; } } @@ -133,7 +133,7 @@ public override void Lock(bool recursive) /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, Index value) { - this.EnsureNotLocked(); + EnsureNotLocked(); index = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Node.cs b/Orm/Xtensive.Orm/Sql/Model/Node.cs index 4dab3e8a4d..07927af311 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Node.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Node.cs @@ -26,7 +26,7 @@ public virtual string Name get { return name; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); name = value; } } @@ -39,7 +39,7 @@ public virtual string DbName get { return string.IsNullOrEmpty(dbName) ? name : dbName; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); dbName = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/NodeCollection.cs b/Orm/Xtensive.Orm/Sql/Model/NodeCollection.cs index 4bccec3e35..bd594c18f2 100644 --- a/Orm/Xtensive.Orm/Sql/Model/NodeCollection.cs +++ b/Orm/Xtensive.Orm/Sql/Model/NodeCollection.cs @@ -41,7 +41,7 @@ public override void Add(TNode item) /// public override void AddRange(IEnumerable nodes) { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (var node in nodes) { Add(node); } diff --git a/Orm/Xtensive.Orm/Sql/Model/PairedNodeCollection.cs b/Orm/Xtensive.Orm/Sql/Model/PairedNodeCollection.cs index b3b33b68ae..80dd0fa13c 100644 --- a/Orm/Xtensive.Orm/Sql/Model/PairedNodeCollection.cs +++ b/Orm/Xtensive.Orm/Sql/Model/PairedNodeCollection.cs @@ -42,7 +42,7 @@ public override void Add(TNode item) /// public override void AddRange(IEnumerable items) { - this.EnsureNotLocked(); + EnsureNotLocked(); foreach (var item in items) { Add(item); } diff --git a/Orm/Xtensive.Orm/Sql/Model/Partitioning/Partition.cs b/Orm/Xtensive.Orm/Sql/Model/Partitioning/Partition.cs index ccf77801e4..739775ea40 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Partitioning/Partition.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Partitioning/Partition.cs @@ -34,7 +34,7 @@ public PartitionDescriptor PartitionDescriptor { get { return partitionDescriptor; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (partitionDescriptor == value) return; if (partitionDescriptor!=null) @@ -54,7 +54,7 @@ public PartitionDescriptor PartitionDescriptor /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, PartitionDescriptor value) { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionDescriptor = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionDescriptor.cs b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionDescriptor.cs index c4ca99ae9f..d26a9ebecd 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionDescriptor.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionDescriptor.cs @@ -60,7 +60,7 @@ public IPartitionable Owner { get { return owner; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); IPartitionable old = owner; owner = value; if (old!=null && old.PartitionDescriptor==this) @@ -79,7 +79,7 @@ public TableColumn Column get { return column; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); column = value; } } @@ -93,7 +93,7 @@ public int PartitionAmount get { return partitionAmount; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionAmount = value; } } @@ -116,7 +116,7 @@ public PartitionMethod PartitionMethod get { return partitionMethod; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionMethod = value; } } @@ -130,7 +130,7 @@ public PartitionSchema PartitionSchema get { return partitionSchema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); partitionSchema = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionFunction.cs b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionFunction.cs index 7c90459697..91a8be6291 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionFunction.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionFunction.cs @@ -27,7 +27,7 @@ public SqlValueType DataType get { return dataType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); dataType = value; } } @@ -41,7 +41,7 @@ public BoundaryType BoundaryType get { return boundaryType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); boundaryType = value; } } @@ -56,7 +56,7 @@ public string[] BoundaryValues get { return boundaryValues; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); boundaryValues = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionSchema.cs b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionSchema.cs index 4a7fbbbd04..f808c31060 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionSchema.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Partitioning/PartitionSchema.cs @@ -38,7 +38,7 @@ public PartitionFunction PartitionFunction { get { return partitionFunction; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (partitionFunction == value) return; if (value!=null && Catalog!=null && !Catalog.PartitionFunctions.Contains(value)) diff --git a/Orm/Xtensive.Orm/Sql/Model/Partitioning/RangePartition.cs b/Orm/Xtensive.Orm/Sql/Model/Partitioning/RangePartition.cs index 5ad30791a1..8bf1bfcf75 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Partitioning/RangePartition.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Partitioning/RangePartition.cs @@ -24,7 +24,7 @@ public string Boundary get { return boundary; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); boundary = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Schema.cs b/Orm/Xtensive.Orm/Sql/Model/Schema.cs index d3e1ba6771..da71e0a5fc 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Schema.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Schema.cs @@ -190,7 +190,7 @@ public CharacterSet DefaultCharacterSet return null; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (defaultCharacterSet == value) return; if (value!=null && !CharacterSets.Contains(value)) diff --git a/Orm/Xtensive.Orm/Sql/Model/SchemaNode.cs b/Orm/Xtensive.Orm/Sql/Model/SchemaNode.cs index d117b89558..497d81cf6d 100644 --- a/Orm/Xtensive.Orm/Sql/Model/SchemaNode.cs +++ b/Orm/Xtensive.Orm/Sql/Model/SchemaNode.cs @@ -22,7 +22,7 @@ public Schema Schema { get { return schema; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (schema != value) ChangeSchema(value); } @@ -43,7 +43,7 @@ public Schema Schema /// The collection owner. void IPairedNode.UpdatePairedProperty(string property, Schema value) { - this.EnsureNotLocked(); + EnsureNotLocked(); schema = value; } diff --git a/Orm/Xtensive.Orm/Sql/Model/Sequence.cs b/Orm/Xtensive.Orm/Sql/Model/Sequence.cs index b7337bed5b..3dcecaf34c 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Sequence.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Sequence.cs @@ -23,7 +23,7 @@ public SequenceDescriptor SequenceDescriptor { get { return sequenceDescriptor; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ArgumentValidator.EnsureArgumentNotNull(value, "value"); sequenceDescriptor = value; SequenceDescriptor old = sequenceDescriptor; diff --git a/Orm/Xtensive.Orm/Sql/Model/SequenceDescriptor.cs b/Orm/Xtensive.Orm/Sql/Model/SequenceDescriptor.cs index 6b3a3e812e..7817a69373 100644 --- a/Orm/Xtensive.Orm/Sql/Model/SequenceDescriptor.cs +++ b/Orm/Xtensive.Orm/Sql/Model/SequenceDescriptor.cs @@ -29,7 +29,7 @@ public ISequenceable Owner { get { return owner; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); ISequenceable old = owner; owner = value; if (old!=null && old.SequenceDescriptor==this) @@ -50,7 +50,7 @@ public long? StartValue get { return startValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); startValue = value; } } @@ -66,7 +66,7 @@ public long? Increment { get { return increment; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); if (value.HasValue && value.Value == 0) throw new ArgumentException(Strings.ExIncrementMustNotBeZero); increment = value; @@ -83,7 +83,7 @@ public long? MaxValue { get { return maxValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); maxValue = value; } } @@ -99,7 +99,7 @@ public long? MinValue get { return minValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); minValue = value; } } @@ -112,7 +112,7 @@ public long? LastValue get { return lastValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); lastValue = value; } } @@ -126,7 +126,7 @@ public bool? IsCyclic get { return isCyclic; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isCyclic = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/Table.cs b/Orm/Xtensive.Orm/Sql/Model/Table.cs index e8091f6ab7..e5b9455264 100644 --- a/Orm/Xtensive.Orm/Sql/Model/Table.cs +++ b/Orm/Xtensive.Orm/Sql/Model/Table.cs @@ -117,7 +117,7 @@ public PartitionDescriptor PartitionDescriptor get { return partitionDescriptor; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); PartitionDescriptor old = partitionDescriptor; partitionDescriptor = value; if (old != null && old.Owner == this) @@ -137,7 +137,7 @@ public string Filegroup get { return filegroup; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); filegroup = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/TableColumn.cs b/Orm/Xtensive.Orm/Sql/Model/TableColumn.cs index 8e7cb54a25..1eb05cf3fe 100644 --- a/Orm/Xtensive.Orm/Sql/Model/TableColumn.cs +++ b/Orm/Xtensive.Orm/Sql/Model/TableColumn.cs @@ -32,7 +32,7 @@ public SqlValueType DataType get { return dataType; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); dataType = value; } } @@ -46,7 +46,7 @@ public Domain Domain get { return domain; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); domain = value; } } @@ -59,7 +59,7 @@ public SqlExpression DefaultValue get { return defaultValue; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); defaultValue = value; } } @@ -90,7 +90,7 @@ public SqlExpression Expression get { return expression; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); expression = value; } } @@ -107,7 +107,7 @@ public bool IsPersisted get { return isPersisted; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isPersisted = value; } } @@ -121,7 +121,7 @@ public Collation Collation get { return collation; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); collation = value; } } @@ -137,7 +137,7 @@ public bool IsNullable get { return isNullable; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isNullable = value; } } @@ -151,7 +151,7 @@ public Table Table get { return (Table)DataTable; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); DataTable = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/TemporaryTable.cs b/Orm/Xtensive.Orm/Sql/Model/TemporaryTable.cs index 6185386aa4..7e0b601720 100644 --- a/Orm/Xtensive.Orm/Sql/Model/TemporaryTable.cs +++ b/Orm/Xtensive.Orm/Sql/Model/TemporaryTable.cs @@ -28,7 +28,7 @@ public bool IsGlobal get { return isGlobal; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); isGlobal = value; } } @@ -44,7 +44,7 @@ public bool PreserveRows get { return preserveRows; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); preserveRows = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/View.cs b/Orm/Xtensive.Orm/Sql/Model/View.cs index 889d4e1350..f8920b6d55 100644 --- a/Orm/Xtensive.Orm/Sql/Model/View.cs +++ b/Orm/Xtensive.Orm/Sql/Model/View.cs @@ -47,7 +47,7 @@ public CheckOptions CheckOptions { get { return checkOptions; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); checkOptions = value; } } @@ -61,7 +61,7 @@ public SqlNative Definition get { return definition; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); definition = value; } } diff --git a/Orm/Xtensive.Orm/Sql/Model/ViewColumn.cs b/Orm/Xtensive.Orm/Sql/Model/ViewColumn.cs index d4d70764cd..350ff69dbe 100644 --- a/Orm/Xtensive.Orm/Sql/Model/ViewColumn.cs +++ b/Orm/Xtensive.Orm/Sql/Model/ViewColumn.cs @@ -22,7 +22,7 @@ public View View get { return (View) DataTable; } set { - this.EnsureNotLocked(); + EnsureNotLocked(); DataTable = value; } } diff --git a/Orm/Xtensive.Orm/Sql/SqlExceptionInfo.cs b/Orm/Xtensive.Orm/Sql/SqlExceptionInfo.cs index 5df2ce237f..b63c84b568 100644 --- a/Orm/Xtensive.Orm/Sql/SqlExceptionInfo.cs +++ b/Orm/Xtensive.Orm/Sql/SqlExceptionInfo.cs @@ -26,7 +26,7 @@ public class SqlExceptionInfo : LockableBase /// public SqlExceptionType Type { get { return type; } - set { this.EnsureNotLocked(); type = value; } + set { EnsureNotLocked(); type = value; } } /// @@ -34,7 +34,7 @@ public SqlExceptionType Type { /// public string Database { get { return database; } - set { this.EnsureNotLocked(); database = value; } + set { EnsureNotLocked(); database = value; } } /// @@ -42,7 +42,7 @@ public string Database { /// public string Table { get { return table; } - set { this.EnsureNotLocked(); table = value; } + set { EnsureNotLocked(); table = value; } } /// @@ -50,7 +50,7 @@ public string Table { /// public string Column { get { return column; } - set { this.EnsureNotLocked(); column = value; } + set { EnsureNotLocked(); column = value; } } /// @@ -58,7 +58,7 @@ public string Column { /// public string Value { get { return value; } - set { this.EnsureNotLocked(); this.value = value; } + set { EnsureNotLocked(); this.value = value; } } /// @@ -66,7 +66,7 @@ public string Value { /// public string Constraint { get { return constraint; } - set { this.EnsureNotLocked(); constraint = value; } + set { EnsureNotLocked(); constraint = value; } } /// From 3a0b2d055f878e1d4f9b24db7f4272979d4c94aa Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Mon, 11 Jul 2022 19:32:17 -0700 Subject: [PATCH 2/5] Update Orm/Xtensive.Orm/Core/LockableBase.cs Co-authored-by: Alexey Kulakov --- Orm/Xtensive.Orm/Core/LockableBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orm/Xtensive.Orm/Core/LockableBase.cs b/Orm/Xtensive.Orm/Core/LockableBase.cs index 5709959fe3..fba7f5106a 100644 --- a/Orm/Xtensive.Orm/Core/LockableBase.cs +++ b/Orm/Xtensive.Orm/Core/LockableBase.cs @@ -23,7 +23,7 @@ public abstract class LockableBase: ILockable /// /// Ensures the object is not locked (see ) yet. /// - /// Specified instance is locked. + /// The instance is locked. public void EnsureNotLocked() { if (IsLocked) { From 4cacb4125955cd7cb1f4961a2b1ee9e5477d0fd5 Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Mon, 11 Jul 2022 19:32:36 -0700 Subject: [PATCH 3/5] Update Orm/Xtensive.Orm/Core/LockableBase.cs Co-authored-by: Alexey Kulakov --- Orm/Xtensive.Orm/Core/LockableBase.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Orm/Xtensive.Orm/Core/LockableBase.cs b/Orm/Xtensive.Orm/Core/LockableBase.cs index fba7f5106a..fe8cfa3181 100644 --- a/Orm/Xtensive.Orm/Core/LockableBase.cs +++ b/Orm/Xtensive.Orm/Core/LockableBase.cs @@ -36,8 +36,7 @@ public void EnsureNotLocked() public void Lock() => Lock(true); /// - public virtual void Lock(bool recursive) => - IsLocked = true; + public virtual void Lock(bool recursive) => IsLocked = true; From a2a8ce3961de91a04bcaf2e96f07e24337a6b593 Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Mon, 11 Jul 2022 19:35:18 -0700 Subject: [PATCH 4/5] Remove unnecessary newline --- Orm/Xtensive.Orm/Core/LockableBase.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Orm/Xtensive.Orm/Core/LockableBase.cs b/Orm/Xtensive.Orm/Core/LockableBase.cs index fe8cfa3181..cb42eb5697 100644 --- a/Orm/Xtensive.Orm/Core/LockableBase.cs +++ b/Orm/Xtensive.Orm/Core/LockableBase.cs @@ -31,14 +31,13 @@ public void EnsureNotLocked() } } - /// public void Lock() => Lock(true); /// public virtual void Lock(bool recursive) => IsLocked = true; - + // Constructors From 75834f40313b6a70f1fd4c00ae174ff4112a081b Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Mon, 11 Jul 2022 19:38:11 -0700 Subject: [PATCH 5/5] Mark EnsureNotLocked() extension [Obsolete] --- .../Core/Extensions/LockableExtensions.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs diff --git a/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs b/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs new file mode 100644 index 0000000000..c89c182fbb --- /dev/null +++ b/Orm/Xtensive.Orm/Core/Extensions/LockableExtensions.cs @@ -0,0 +1,29 @@ +// Copyright (C) 2003-2010 Xtensive LLC. +// All rights reserved. +// For conditions of distribution and use, see license. +// Created by: Alex Yakunin +// Created: 2008.07.04 + +using System; + +namespace Xtensive.Core +{ + /// + /// related extension methods. + /// + public static class LockableExtensions + { + /// + /// Ensures is not locked (see ) yet. + /// + /// Lockable object to check. + /// Specified instance is locked. + [Obsolete("Use LockableBase.EnsureNotLocked method instead.")] + public static void EnsureNotLocked(this ILockable lockable) + { + ArgumentValidator.EnsureArgumentNotNull(lockable, "lockable"); + if (lockable.IsLocked) + throw new InstanceIsLockedException(Strings.ExInstanceIsLocked); + } + } +} \ No newline at end of file