I'm not sure of the context of this, but rather than the enum you could use a delegate that performs the desired operation to be passed into your "PerformOperation"-method. However you probably don't even need that static method if you would use this approach. Another benefit is that you don't have to care about the special case where the operation is not supported, any operation is supported. Here's a quick example:
namespace Example
{
using System;
public delegate double Operation(double first, double second);
public static class Operations
{
public static readonly Operation Sum = (first, second) => first + second;
public static readonly Operation Subtract = (first, second) => first - second;
public static readonly Operation Multiply = (first, second) => first * second;
public static readonly Operation Divide = (first, second) => first / second;
}
class Program
{
static void Main(string[] args)
{
double seed = 0;
double aggregateValue = 0;
aggregateValue = PerformOperation(Operations.Sum, 5, 10);
Console.WriteLine(aggregateValue);
aggregateValue = PerformOperation(Operations.Multiply, aggregateValue, 10);
Console.WriteLine(aggregateValue);
aggregateValue = PerformOperation(Operations.Subtract, aggregateValue, 10);
Console.WriteLine(aggregateValue);
aggregateValue = PerformOperation(Operations.Divide, aggregateValue, 10);
Console.WriteLine(aggregateValue);
// You can even pass delegates to other methods with matching signatures,
// here to get the power of ten.
aggregateValue = PerformOperation(Math.Pow, aggregateValue, 10);
Console.WriteLine(aggregateValue);
Console.ReadLine();
}
private static double PerformOperation(Operation operation, double aggregateValue, double sourceValue)
{
return operation(aggregateValue, sourceValue);
}
}
}
Using this approach you can easily extend your program with new operations without even touching the PerformOperation-method. This can be taken quite a few steps further but without knowing the context it's hard to describe.