ObjectContext public in debug mode, internal in release mode
问题 Is there an easy way to make an ObjectContext public in debug mode and internal in release mode? With Linqpad it is very convenient to connect to an ObjectContext for quick testing and querying, so for development purposes I want it to be public. But I don't want to think of the consequences when the same convenience is deployed to some smart customer. 回答1: As mentioned in the comment, this may not be of any practical use, but: #if DEBUG public #endif class YourContext : ObjectContext { ... }