枚举扩展类的命名约定

Bra*_*vic 0 .net c# naming-conventions

假设我有一个enum和一个扩展方法:

public enum EFoo {
    One,
    Two,
    Three
}

public static class FooExt {
    public static void FooMethod(this EFoo foo) {
        // ...
    }
}
Run Code Online (Sandbox Code Playgroud)

扩展类的更好的命名约定是什么:

  • FooExt 如上所示.
  • EFooExt.
  • 别的什么?

我知道这有点主观,可能不是SO的最佳问题,但我想知道到目前为止是否有一个既定的惯例逃过了我?

SLa*_*aks 6

Enum应该命名Foo,而不是EFoo.
C#不鼓励匈牙利表示法.

然后应该命名扩展类 FooExtensions