I wrote an EF browser to dynamically navigate through entities. Beside basic properties of system types, each entity can have several singular or plural navigation properties. In order to support all of these using a single batch of code, I come up with the following solution considering the following requirement:Each entity has an integer ID primary key.Sample query strings (Person is an entity (ID = 10) with Job and Cars navigation property):Person/10/JobPerson/10/CarsSolution:public List<dynamic> LoadEntitiesByQuery(String query) {    String[] parts = query.Split(/.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);    String entityName = parts[0];    int id = int.Parse(parts[1]);    String subEntityName = parts[2];    Type entityType = GetTypeFromEntityName(entityName);    var tempObj = db.Set(entityType)                    .AsQueryable()                    .Where(String.Format(ID == {0}, id))                    .FirstOrDefault();    var propertyInfo = tempObj.GetType().GetProperty(subEntityName);    List<dynamic> objects;    if (propertyInfo.PropertyType.IsGenericType)        objects = ((IEnumerable<dynamic>)propertyInfo.GetValue(tempObj, null)).ToList();    else    {        var tr = propertyInfo.GetValue(tempObj, null);        objects = new List<dynamic>();        objects.Add(tr);    }    return objects;}internal static Type GetTypeFromEntityName(string entityName){    Type entityType = null;    switch (entityName)    {        case Person:            entityType = typeof(Person);            break;        case Job:            entityType = typeof(Job);            break;        ///  ....    }    return entityType;}I'm looking for faster ways of doing dynamic query instead of reflection.
Dynamic Linq from string with EF
c#;strings;linq;entity framework