Anonymous type result from sql query execution entity framework
You have to use raw Sql for that, the entitity framework SqlQuery<T> will only work for objects with known types. here is the method I use : public static IEnumerable<dynamic> DynamicListFromSql(this DbContext db, string Sql, Dictionary<string, object> Params) { using (var cmd = db.Database.Connection.CreateCommand()) { cmd.CommandText = Sql; if (cmd.Connection.State != ConnectionState.Open) { cmd.Connection.Open(); } … Read more