Tyrael Archangel
Tyrael Archangel

Reputation: 487

C# - ExpandoObject definition

Looking at the definition of System.Dynamic.ExpandoObject i came across this:

public sealed class ExpandoObject : IDynamicMetaObjectProvider, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, INotifyPropertyChanged
{
    public ExpandoObject();
}

Why does the ExpandoObject class not implement the interfaces?

Upvotes: 1

Views: 459

Answers (3)

Dan Carlstedt
Dan Carlstedt

Reputation: 311

Using something like .Net Reflector you can see the implementation of each interface. The code is too long to post here but it is all in there. Simply do a search within reflector for the ExandoObject and you will see the members.

Upvotes: 1

Tigran
Tigran

Reputation: 62248

I used ILSpy on System.Core 4.0.0.0 and get

enter image description here

So implentations are present actually...

Upvotes: 0

Magnus
Magnus

Reputation: 46909

The ExpandoObject has an explicit implementation of the interfaces. Explicit implentation allows it to only be accessible when cast as the interface itself.

Upvotes: 2

Related Questions