.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;

Test(new List<int>());
Test(new List<int>(){ 2 });
Test(new List<int>(){});
Test(new List<int>(){ 2, 3 });
Test(new List<int>(){ 2, 3, 5, 7 });
Test(new List<int>(){ 2, 3, 5, 7, 11 });

static void Test<T>(List<T> lst)
{
   Console.Write("Avant : "); Afficher(lst);
   Inverser(lst);
   Console.Write("Après : "); Afficher(lst);
}
static void Afficher<T>(IEnumerable<T> elems)
{
   foreach(T e in elems)
      Console.Write($"{e} ");
   Console.WriteLine();
}
static void Inverser<T>(List<T> lst)
{
   int milieu = lst.Count / 2;
   for(int i = 0; i < milieu; ++i)
      (lst[i], lst[lst.Count - i - 1]) = (lst[lst.Count - i - 1], lst[i]);
}
;