Main
Console.WriteLine("Digite os valores");
string n1 = Console.ReadLine()!;
int a = int.Parse(n1);
Console.WriteLine("Digite os valores");
string n2 = Console.ReadLine()!;
int b = int.Parse(n2);
Console.WriteLine($"Total: {Somatorio.Somar(a, b)}");
Classe
public static class Somatorio
{
public static int Somar(int a, int b) => a + b;
}