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 283999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:25:16+00:00 2026-05-12T05:25:16+00:00

From Framework Design Guidelines: DO NOT implement value equality on mutable reference types. [p-270]

  • 0

From Framework Design Guidelines:

DO NOT implement value equality on mutable reference types. [p-270]

From Eric Evans’s DDD:

Each ENTITY must have an operational way of establishing its identity with another object. [p-94]

Should I treat overriding Object.Equals method as identity operation or just compare the Identity attribute (e.g. customer1.Id == customer2.Id)?

  • 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-05-12T05:25:16+00:00Added an answer on May 12, 2026 at 5:25 am

    There are three cases you might want to be able to distinguish.

    1. You have two references to the same entity. In this case the normal equality operators will do their jobs correctly. No need to override anything.

    2. You have two instances in memory of the same entity. When you design your repositories right this situation is avoidable but sometimes this is a situation you’ll have to work with. Your customer1.Id == customer2.Id example will work fine in this case.

    3. You have two different entities but you want to know if they have similar property value’s. This might be a code-smell. You might be treating a value type as an entity. If this is really something you want to do then you should implement it separately from the normal .net == and .Equals mechanisms. (for example .IsSameAs(Customer subject)) to avoid confusion.

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

Sidebar

Related Questions

This query is about MVC design pattern in general and not ASP.net MVC framework
I have inherited a application framework from the previous developer where I now work.
I've recently updated an application to the 3.5 framework (from 2.0). The app links
I have a problem with the following Linq query using Entity Framework: from o
In several questions I've seen recommendations for the Spirit parser-generator framework from boost.org ,
From the first days the .NET framework came out there was a minimum OS
From within my Java program I want to determine which .NET Framework is installed
I'm using Entity Framework O/R mapper from Microsoft and using entity classes (generated classes
My C++ framework has Buttons. A Button derives from Control. So a function accepting
I have a framework that loads a lot of child collections from a non-database

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.