Skip to content

With complex types GetInterface() dont find interface "IDictionary`2" #2

@evorios

Description

@evorios

https://github.com/loune/MVCStuff/blob/master/Extensions/DefaultDictionaryBinder.cs#L53
.NET4.5
I have MyViewModel with type Dictionary<id, ComplexType>.
GetInterfaces(typeof(MyViewModel)) return 3 interfaces:

  1. System.Collections.Generic.ICollection'1[[System.Collections.Generic.KeyValuePair'2[[System.Int32, ...],[namespace.Models.MyViewModel, ...]]
  2. System.Collections.Generic.IEnumerable'1[[System.Collections.Generic.KeyValuePair'2[[System.Int32, ...],[namespace.Models.MyViewModel, ...]]
  3. System.Collections.IEnumerable

So, code modelType.GetInterface("System.Collections.Generic.IDictionary'2") return null. And extension dont work.
How to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions