0
kicks
C# methods decoration using lambda expressions
On regular basis several repeating code blocks appear in projects source code. Wouldn't it be great if we could just say: here is my method, do call within TCF block ("try - catch - finally" block) first time I need it, but I may require to call it with "try - catch" block only next time or with other catch block content (say I had logging there, but decided to remove or replace it for some special cases of this method call):
// Like this
return MyMethod1.TCF(ex => Log(ex), arg => DoSomeFinallyAction(arg))(arg);