Generic Method


I’ve come up with a pretty neat solution to this:
If you don’t want to write the same method for different data types, you can use generics.

It’s pretty easy once you know what to look for 🙂 Just search Generics c# and you’ll find a bunch of questions and answers on StackOverflow, msdn and CodeProject 🙂
Here’s the solution:

Pretty Cool eh!? 🙂

Now instead of having multiple methods to make the same operation, you have one that works for many types.