Like an internal expando object

I am really interested to know how the Expando object is implemented in .Net 4.0?

+4
source share
4 answers

It is implemented as an internal dictionary.

Check out Alexander Rusina’s blog on the topic here , and mine.

+2
source

You do not need to bother with Reflector, the DLR source code is easily available for download here . Wonderfully commented. You will find the source code for ExpandoObject in src \ Runtime \ Microsoft.Scripting.Core \ Actions \ ExpandoObject.cs

The data store for ExpandoObject is ExpandoData, available in the same source file. Values ​​are stored in a simple object []. ExpandoClass (the same directory) tracks keys in a simple string []. ExpandoObject definitely doesn’t use a dictionary, as mentioned earlier, but it implements IDictionary.

+8
source

Use the Reflector , which now supports .Net 4.0.

+1
source

The surest way to find out is to use Reflector v6 : .NET Reflector Demo

0
source

Source: https://habr.com/ru/post/1303525/


All Articles