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

  • SEARCH
  • Home
  • 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 7955805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:48:07+00:00 2026-06-04T03:48:07+00:00

The C# team has previously considered adding extension properties, events, etc. to C#. Per

  • 0

The C# team has previously considered adding extension properties, events, etc. to C#.

Per Eric Lippert:

http://blogs.msdn.com/b/ericlippert/archive/2009/10/05/why-no-extension-properties.aspx

For these features to be useful however, they would have to be able to store some new kind of state with an object. It seems like the only way to do this would be to use a dictionary and associate each instance of an object with whatever the additional state is.

It would be useful if it were possible to copy this functionality “manually” by creating my own dictionary (and perhaps get/set extension methods). However, in order to associate a particular instance of an object with some state you would need to hash the actual reference to the object. In another language you might do this by hashing its memory location, however in C# that is not guaranteed to stay constant, and using unsafe code to accomplish this feature is far from ideal anyway.

Does anyone know if it’s possible to get some hashable reference to an object that does not change as the object’s internal state changes? There obviously is some internal mechanism to keep track of individual objects regardless of their memory location, but I’m not sure if that is exposed to user code.

Note: Simply hashing the object itself will not work at all, because GetHashCode() depends on an object’s internal state not on which object it is.

Thanks for any insight.

  • 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-04T03:48:09+00:00Added an answer on June 4, 2026 at 3:48 am

    You’re looking for the ConditionalWeakTable class.

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

Sidebar

Related Questions

Visual Studio 2008 has built-in unittesting that was previously only available in the Team
Our team has just started developing for the Sitecore CMS. We find that after
Our team has recently been working on a logic and data layer for our
Our team has recently been considering pushing out a minor registry fix to users
My team has a situation where an SNMP SET will fail once every two
One of my team has recently come across an interesting glitch in the matrix.
My capstone team has decided to use Qooxdoo as the front end for our
My question may sound a little bit stupid. My team has to test a
My team currently has a development web/database server and a live deployment web server
I work with a team that has a sharepoint site currently runnning and its

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.