Hide private partial class/struct members
I am generating code based on a given class, this partial class contains a generated public interface and generated private members. Is it possible to hide the visibility of private members for the original non-generated class?
Some code example
3 Replies
No. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/file allows you to hide a separate type you define in a generated type, but it doesn't allow you to hide an entire partial part
file keyword - C# Reference - C#
file modifier: Declare types whose scope is the file in which it's declared
Is there any other workaround? I already created separate class with file accessor but it only helps with fields. Methods can't be moved, as they need to access other private method defined in original partial class
No