net_automatic_interface icon indicating copy to clipboard operation
net_automatic_interface copied to clipboard

Enable internal classes

Open anotherthomas opened this issue 1 year ago • 7 comments

To facilitate API design for assemblies, [GenerateAutomaticInterface] should take internal visibility into account. The interface can be useful for dependency injection without necessarily being part of the public API of an assembly.

anotherthomas avatar Mar 20 '24 20:03 anotherthomas

I like it, can you do a few things:

  1. Add tests for all relevant cases (no modifies, public, private, internal, protected?) Ideally add another partial class for that, the current test class is a "little" long.
  2. Bump the version to next major - this is a breaking change
  3. Mention it in the readme

Thanks!

ChristianSauer avatar Mar 21 '24 07:03 ChristianSauer

Sure thing

anotherthomas avatar Mar 21 '24 07:03 anotherthomas

So, working on the broader topic, what would we want to have? Going over https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers:

  • public and internal classes :heavy_check_mark:
  • nested classes other than public/internal :question: , but I don't see the use case

Wrt. nested members:

  • restrict to public within public classes :heavy_check_mark:
  • public and protected in protected classes :question:

What are your thoughts on that?

anotherthomas avatar Apr 01 '24 12:04 anotherthomas

Sorry, I was occupied :( After reading - i would say both question marks are out of scope for now. Let's start with the simple stuff...

ChristianSauer avatar Apr 15 '24 14:04 ChristianSauer

Tests split, version bumped :)

anotherthomas avatar Apr 16 '24 10:04 anotherthomas

Sorry, had several things on my plate those last few months. Still interested?

anotherthomas avatar Aug 06 '24 05:08 anotherthomas

Yes! You need probably to rebase

ChristianSauer avatar Aug 06 '24 06:08 ChristianSauer