In C #, when I have different sections of code, such as constants, API functions, helper functions, etc., I would like to separate them. I usually use something like this:
public class Foo {
private const string VIP = "Cob H.";
private const int IMPORTANT_NUMBER = 23;
[WebMethod(MessageName = "SomeInformation")]
public string SomeInformation() {
return VIP + " is dead.";
}
private class IrrelevantClass {
public string Name { get; set; }
public string City { get; set; }
}
}
Is there an elegant way to separate them instead of using a bunch of ugly comments? As in Objective-C, you can use
#pragma mark - Inner Classes
I looked through all the keywords in a pragmatic list in C #, and none of them look promising.
source
share