Skip to content

Commit 19d842c

Browse files
authored
Replace ArgumentValidator.EnsureArgumentNotNull() by ArgumentNullException.ThrowIfNull() (#264)
* Replace `ArgumentValidator.EnsureArgumentNotNull()` by `ArgumentNullException.ThrowIfNull()` * Avoid quoted * Avoid nameof
1 parent b2bd069 commit 19d842c

File tree

279 files changed

+1142
-1163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+1142
-1163
lines changed

Orm/Xtensive.Orm.Tests.Core/Modelling/IndexingModel/TypeInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public TypeInfo(Type type, int length, int scale, int precision)
188188

189189
public TypeInfo(Type type, bool isNullable)
190190
{
191-
ArgumentValidator.EnsureArgumentNotNull(type, "type");
191+
ArgumentNullException.ThrowIfNull(type);
192192
if (isNullable && type.IsValueType && !type.IsNullable())
193193
ArgumentValidator.EnsureArgumentIsInRange(true, false, false, "isNullable");
194194
Type = type;
@@ -205,7 +205,7 @@ public TypeInfo(Type type, bool isNullable, int length)
205205
public TypeInfo(Type type, bool isNullable, int length, CultureInfo culture)
206206
: this(type, isNullable, length)
207207
{
208-
ArgumentValidator.EnsureArgumentNotNull(culture, "culture");
208+
ArgumentNullException.ThrowIfNull(culture);
209209
Culture = culture;
210210
}
211211

@@ -216,4 +216,4 @@ public TypeInfo(Type type, bool isNullable, int length, int scale, int precision
216216
Precision = precision;
217217
}
218218
}
219-
}
219+
}

Orm/Xtensive.Orm.Tests.Core/Reflection/DelegateHelperCreateDelegateTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private static void LogicTest(Type[] types, object callTarget, Type type, string
132132

133133
public static IEnumerable<TItem> Reverse<TItem>(IList<TItem> list)
134134
{
135-
ArgumentValidator.EnsureArgumentNotNull(list, "list");
135+
ArgumentNullException.ThrowIfNull(list);
136136
for (int i = list.Count-1; i>=0; i--)
137137
yield return list[i];
138138
}

Orm/Xtensive.Orm.Tests.Core/Tuples/DummyTuple.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public override void SetValue(int fieldIndex, object fieldValue)
8181

8282
public DummyTuple(TupleDescriptor descriptor)
8383
{
84-
ArgumentValidator.EnsureArgumentNotNull(descriptor, "descriptor");
84+
ArgumentNullException.ThrowIfNull(descriptor);
8585
this.descriptor = descriptor;
8686
values = new object[descriptor.Count];
8787
available = new BitArray(new bool[descriptor.Count]);

Orm/Xtensive.Orm.Tests.Framework/Internals/InstanceGeneratorBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ IEnumerable IInstanceGeneratorBase.GetInstances(Random random, int? count)
6464
/// <param name="provider">Instance generator provider this generator is bound to.</param>
6565
public InstanceGeneratorBase(IInstanceGeneratorProvider provider)
6666
{
67-
ArgumentValidator.EnsureArgumentNotNull(provider, "provider");
67+
ArgumentNullException.ThrowIfNull(provider);
6868
this.provider = provider;
6969
}
7070

Orm/Xtensive.Orm.Tests.Framework/TestSqlDriver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class TestSqlDriver
1818

1919
public static SqlDriver Create(UrlInfo connectionUrl)
2020
{
21-
ArgumentValidator.EnsureArgumentNotNull(connectionUrl, "connectionUrl");
21+
ArgumentNullException.ThrowIfNull(connectionUrl);
2222
return BuildDriver(new ConnectionInfo(connectionUrl));
2323
}
2424

@@ -37,7 +37,7 @@ public static SqlDriver Create(string provider, string connectionString)
3737

3838
public static SqlDriver Create(ConnectionInfo connectionInfo)
3939
{
40-
ArgumentValidator.EnsureArgumentNotNull(connectionInfo, "connectionInfo");
40+
ArgumentNullException.ThrowIfNull(connectionInfo);
4141
return BuildDriver(connectionInfo);
4242
}
4343

Orm/Xtensive.Orm.Tests/Linq/FullTextColumnsDeclarationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private void RunQuery<T>(Expression<Func<T, object>>[] columns)
104104
private Expression<Func<T, object>>[] MakeUpColumns<T>(Expression<Func<T, object>> column, params Expression<Func<T, object>>[] additionalColumns)
105105
where T : Entity
106106
{
107-
ArgumentValidator.EnsureArgumentNotNull(column, "column");
107+
ArgumentNullException.ThrowIfNull(column);
108108
var columns = new List<Expression<Func<T, object>>>();
109109
columns.Add(column);
110110
if (additionalColumns!=null) {

Orm/Xtensive.Orm/Arithmetic/ArithmeticBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public Arithmetic<T> ApplyRules(ArithmeticRules rules)
117117
/// <param name="rules">Arithmetic rules.</param>
118118
public ArithmeticBase(IArithmeticProvider provider, ArithmeticRules rules)
119119
{
120-
ArgumentValidator.EnsureArgumentNotNull(provider, "provider");
120+
ArgumentNullException.ThrowIfNull(provider);
121121
this.provider = provider;
122122
Rules = rules;
123123
OverflowAllowed = (rules.OverflowBehavior==OverflowBehavior.AllowOverflow);

Orm/Xtensive.Orm/Arithmetic/WrappingArithmetic{T,TBase}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public abstract class WrappingArithmetic<T, TBase> : ArithmeticBase<T>
3434
public WrappingArithmetic(IArithmeticProvider provider, ArithmeticRules rules)
3535
: base(provider, rules)
3636
{
37-
ArgumentValidator.EnsureArgumentNotNull(provider, "provider");
37+
ArgumentNullException.ThrowIfNull(provider);
3838
BaseArithmetic = provider.GetArithmetic<TBase>();
3939
}
4040
}

Orm/Xtensive.Orm/Caching/CacheBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public abstract class CacheBase<TKey, TItem> : ICache<TKey, TItem>
3939
/// <inheritdoc/>
4040
public virtual void Remove(TItem item)
4141
{
42-
ArgumentValidator.EnsureArgumentNotNull(item, "item");
42+
ArgumentNullException.ThrowIfNull(item);
4343
RemoveKey(KeyExtractor(item));
4444
}
4545

Orm/Xtensive.Orm/Caching/FastConcurrentLruCache{TKey, TItem}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class FastConcurrentLruCache<TKey, TItem> :
4343
/// <inheritdoc/>
4444
public override TItem Add(TItem item, bool replaceIfExists)
4545
{
46-
ArgumentValidator.EnsureArgumentNotNull(item, "item");
46+
ArgumentNullException.ThrowIfNull(item);
4747
var key = KeyExtractor(item);
4848
if (replaceIfExists) {
4949
realCache.AddOrUpdate(key, item);

0 commit comments

Comments
 (0)