All articles

Miért szeretem a dynamic típust reflection helyett?

Published 2010-05-17 - Last modified 2010-05-17

Ezért:

var allEntities = (IEnumerable)reposType.GetMethod(“GetAll”, new Type[] { typeof(string[]) }).Invoke(repos, new object[] { includes });

vs.

var allEntities = (IEnumerable)repos.GetAll(includes);

Emellett a dynamic vagy 10x gyorsabb, még akkor is, ha a reflectionnél cachelem a típusleírókat.