Recently I read good Russian post with many interesting extensions methods after then I remembered that I too have one good extension method “Safely type convert”. Idea of this method I got at last job.
We often write code like this:
This is method how to safely parse object to int. Of course will be good if we will create some unify method for safely casting.
I found that better way is to create extension methods and use them then follows: