As mentioned in the comment, this may not be of any practical use, but:
#if DEBUG
public
#endif
class YourContext : ObjectContext
{
...
}
When dealing with a generated ObjectContext
from a .edmx file, you'll need to customize how C# files are generated. The default is not customizable, but the designer has an option "Add Code Generation Item". If you use this, you'll get several options. I'm using "ADO.NET Self-Tracking Entity Generator", but the same way works for all of them. Choosing this adds two template files (Model.tt and Model.Context.tt) to your project, which you are free to modify as you see fit. For the modification you're asking about, you'll find <#=Accessibility.ForType(container)#> partial class
in the Model.Context.tt
file. You can update this so that it reads
#if DEBUG
<#=Accessibility.ForType(container)#>
#endif
partial class