Documentation/articles/patching-postfix.md
A postfix is a method that is executed after the original method. It is commonly used to:
Since the postfix has access to the result of the original (or a prefix that has skipped the original), it can read or alter the result by using the argument __result. It must match the return type of the original or be assignable from it.
[!code-csharpexample]
An alternative way to change the result of an original method is to use a pass through postfix. A pass through postfix has a non-void return type that matches the type of the first argument (normal rules apply to the remaining arguments).
Harmony will call the postfix with the result of the original and will use the result of the postfix to continue. Since this works for all types, it is especially useful for types like IEnumerable<T> that cannot be combined with ref. This allows for changing the result with yield operations.
[!code-csharpexample]
There are many ways to access original arguments and even private fields: by name convention and by attributes. You can read more about that in the Injections chapter. Here is a simple example:
[!code-csharpexample]
Harmony will not skip any postfix regardless of what any prefix or the original method do. It is good style to use postfixes as much as possible since they lead to more compatible code.
See prefix