All articles

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

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

Original: https://soci.hu/blog/index.php/2010/05/17/miert-szeretem-a-dynamic-tipust-reflection-helyett/

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.