Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8872497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:14:08+00:00 2026-06-14T18:14:08+00:00

is there a straight forward way in .NET to compare two objects of same

  • 0

is there a straight forward way in .NET to compare two objects of same types.

Is there something like Compare(Object1, Object2) that can return a bool based on equality of the object properties values?

I have read about the IComparable and IComparer interfaces but I am looking at comparision of all the properties instead of just one or two.

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:14:09+00:00Added an answer on June 14, 2026 at 6:14 pm

    In general, what you describe is part of the contract of the Equals() method, depending on the particulars of the class in question.

    Each class where it is relevant should implement Equals based on its own semantics.

    Formally, per the Microsoft article

    http://msdn.microsoft.com/en-us/library/vstudio/336aedhh(v=vs.100).aspx

    the contract is:

    x.Equals(x) returns true.

    x.Equals(y) returns the same value as y.Equals(x).

    (x.Equals(y) && y.Equals(z)) returns true if and only if x.Equals(z) returns true.

    Successive invocations of x.Equals(y) return the same value as long as the objects referenced by x and y are not modified.

    x.Equals(null) returns false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any straight-forward way (by use of cmdlets or .NET classes) to obtain
Is there any straight forward way to do that? I want to give an
Is there a straight forward way to keep track of game time in Android
Is there a straight forward way to view the SQL command text actually executed
Is there a straight-forward way to implement a method with the following signature? At
Please, can someone PLEASE give a simple, straight-forward way to enable ASP.NET > Kerberos
Is there a direct route that is pretty straight forward? (i.e. can SQL Server
I am wondering if there is a straightforward way to use .NET's built in
Is there a straightforward way to enumerate all visible network printers in .NET? Currently,
I figure this is a straight forward question, and I think there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.