0

Let's say I have an enum and an extension method for it:

public enum EFoo {
    One,
    Two,
    Three
}

public static class FooExt {
    public static void FooMethod(this EFoo foo) {
        // ...
    }
}

What would be a better naming convention for the extension class:

  • FooExt as shown above.
  • EFooExt.
  • Something else?

I know this is somewhat subjective and probably not the best question for SO, but I was wondering if there is an established convention that escaped me so far?

4

1 回答 1

6

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

然后应该命名扩展类FooExtensions

于 2013-06-28T11:51:27.157 回答