By 'overflow', did you mean it will exceed int.MaxValue
?
If so, try to use checked
block.
As @AlexD mentioned in comments, it won't perform a prior-check; however, it will raise an exception in case of overflow.
Quote and code sample are taken from MSDN:
The checked keyword is used to explicitly enable overflow checking for integral-type arithmetic operations and conversions.
// If the previous sum is attempted in a checked environment, an
// OverflowException error is raised.
// Checked expression.
Console.WriteLine(checked(2147483647 + ten));
// Checked block.
checked
{
int i3 = 2147483647 + ten;
Console.WriteLine(i3);
}