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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:41:31+00:00 2026-05-15T03:41:31+00:00

Does C# 4.0’s ExpandoObject support Prototype-based inheritance ? If not, why not (was it

  • 0

Does C# 4.0’s ExpandoObject support Prototype-based inheritance? If not, why not (was it by design?) and how could this be implemented? If yes, how does it work and what differences are there compared to the way it works in Javascript?

  • 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-15T03:41:32+00:00Added an answer on May 15, 2026 at 3:41 am

    Does C# 4.0’s ExpandoObject support Prototype-based inheritance?

    First off, note that the ExpandoObject class has nothing whatsoever to do with C# 4.0. The C# team did not design or implement this object. C# 4.0 and the ExpandoObject class merely happen to both ship with the latest version of .NET.

    To answer your question I refer you to the documentation for ExpandoObject, which clearly states:

    The ExpandoObject class is an implementation of the dynamic object concept that enables getting, setting, and invoking members. If you want to define types that have their own dynamic dispatch semantics, use the DynamicObject class.

    As the documentation states, if you want custom dispatch semantics above mere invoking of members then use the DynamicObject class.

    If not, why not? was it by design?

    Someone might want an expando object but that person might neither want nor need prototype inheritance. Expando objects do not logically require any form of inheritance.

    how could this be implemented?

    Use the DynamicObject object. Write your own prototype inheritance mechanism.

    If yes, how does it work and differences are there to the way it works in Javascript?

    If you are attempting to write your own prototype inheritance that is exactly like JScript’s, I encourage you to read the ECMAScript specification extremely carefully. Prototype inheritance looks simple, but there are subtleties that most people get wrong. For example, even JScript experts often get this little puzzle wrong. What does this JScript code print?

    var Animal = new Object(); 
    function Reptile() { } 
    Reptile.prototype = Animal; 
    var lizard = new Reptile(); 
    print(lizard instanceof Reptile); // this is true
    print(lizard.constructor == Reptile);  // is this true or false? explain your answer!
    

    Prototype inheritance does not always work the way you think it does! For an explanation of what this prints and why, see my article on the subject.

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

Sidebar

Related Questions

Does the G'MIC (Grey's Magic Image Converter) library work on iOS ? what steps
Does anybody know why this function, when passed an invalid date (e.g. timestamp) to
Does jQuery 1.5.1 support attribute selectors in the closest method? Given the structure below,
Does anyone know how to make this code stop the knob from rotating past
Does this line of Perl really do anything? $variable =~ s/^(\d+)\b/$1/sg; The only thing
Does doxygen doesn't work properly on python script with a shebang? I tried one
Does anyone know why this bean is getting instantiated multiple times? I only ever
does anyone know if iOS Simulator (that goes with XCode) support any kind of
Does OpenJPA have any support for batch insert similar to Hibernate ? I haven't
Does anybody know about differences in the drag-and-drop behavior between JDK1.6 and JDK1.7 ?

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.