Generic Methods in C# — a practical guide to C# generic methods with clear examples you can reuse in real projects.
C# Tutorial Series (72/121). Prefer one article? Read the complete C# tutorial.
Short description
Type inference usually supplies T at the call site.
Generic method
void PrintAll<T>(IEnumerable<T> items)
{
foreach (var i in items) Console.WriteLine(i);
}