public static ParsedMethodBody GetParsedMethodBody(this ConstructorInfo constructor) => ParsedMethodBody .Create ( constructor, GetInstructionsFromILByteArray ( constructor.GetMethodBody().GetILAsByteArray(), constructor.Module, constructor.ReflectedType.GetGenericArguments(), Type.EmptyTypes ).ToArray() );
public static Option <ParsedMethodBody> GetParsedMethodBody(this MethodInfo method) => Option .FromNullable(method.GetMethodBody()) .Map(methodBody => GetInstructionsFromILByteArray(methodBody.GetILAsByteArray(), method.Module, method.ReflectedType.GetGenericArguments(), method.GetGenericArguments())) .Map(instructions => ParsedMethodBody.Create(method, instructions.ToArray()));