© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
14 replies
_giuraemanuel

❔ Nullability issue

I have this code
        public bool Equals(Money money)
        {
            if (money is null)
            {
                return false;
            }

            if (ReferenceEquals(this, money))
            {
                return true;
            }

            return Currency.CurrencyCode == money.Currency.CurrencyCode && Amount == money.Amount;
        }
        public bool Equals(Money money)
        {
            if (money is null)
            {
                return false;
            }

            if (ReferenceEquals(this, money))
            {
                return true;
            }

            return Currency.CurrencyCode == money.Currency.CurrencyCode && Amount == money.Amount;
        }

and i get this warning. How can i fix it?
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ EF Core nullability vs API nullability behavior
C#CC# / help
4y ago
Puzzled about Nullability in EFCore
C#CC# / help
14mo ago
✅ EFCore Nullability and Circular References
C#CC# / help
4y ago
Getting Rid of Nullability Warnings
C#CC# / help
4y ago