|
|
submitted by
Nextender
7 months, 10 days ago
nextension.blogspot.com — 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);
|
|
tags:
Expressions, Lambda, C# | tag it
Everyones tags: | Your tags: | |
|
|
|
Add a live kick counter to your blog >>
You can even customize the image by choosing your own colors, and then clicking
the button below to update the preview and the html code:
Simply copy and paste this HTML into your blog post.
Users who kicked this story:
No comments so far
|