Prefer pattern matching over equality/inequality operators for null checks.
public class TestClass {
public void TestMethod(object? o) {
if (o == null) {
throw new ArgumentNullException();
}
}
}
public class TestClass {
public void TestMethod(object? o) {
if (o is null) {
throw new ArgumentNullException();
}
}
}
Copyright © 2025 Bluehill