Я пытаюсь понять AST в C #. Интересно, что именно делает метод Compile ()
из этого примера.
// Some code skipped
Expression<Func<string, int, int, string>> data = Expression.Lambda<Func<string, int, int, string>>(
Expression.Call(s, typeof(string).GetMethod(“Substring”, new Type[] { typeof(int), typeof(int) }), a, b),
s, a, b
);
Func<string, int, int, string> fun = data.Compile();
Во избежание недоразумений я понимаю конструкции Expression.Lambda
и Expression.Call
. Меня интересует метод Compile ()
. Он как-то выдает настоящий MSIL? Могу ли я увидеть MSIL?