Description
Unity Abstractions relies on IEquatable<> to determine compatibility of dependencies with various injected members.
Problem
IEquatable<T> interface implements one method: bool Equals(T? other)
The other parameter is passed as nullable, so before it is used, it needs to be checked for null. Every call to this method adds a null check although it is never null.
Solution
To resolve this issue IEquatable<T> interface should be replaced with custom interface:
public interface IMatch<T>
{
public bool Match(T other);
}
Impact
Custom Injection Members will require refactoring.
Description
Unity Abstractions relies on
IEquatable<>to determine compatibility of dependencies with various injected members.Problem
IEquatable<T>interface implements one method:bool Equals(T? other)The
otherparameter is passed as nullable, so before it is used, it needs to be checked for null. Every call to this method adds a null check although it is nevernull.Solution
To resolve this issue
IEquatable<T>interface should be replaced with custom interface:Impact
Custom Injection Members will require refactoring.