Skip to content

Comments

Add opportunity to search interface implementations over multiple assemblies#28

Closed
Thinspeed wants to merge 1 commit intoDreamescaper:mainfrom
Thinspeed:feature-add-multiple-assemblies
Closed

Add opportunity to search interface implementations over multiple assemblies#28
Thinspeed wants to merge 1 commit intoDreamescaper:mainfrom
Thinspeed:feature-add-multiple-assemblies

Conversation

@Thinspeed
Copy link

No description provided.

@Dreamescaper
Copy link
Owner

Thanks for your contribution. Still, it would be better to create an issue with suggested functionality beforehand.

Could you describe your use case?
It is possible to add multiple attributes to the same method. Would that resolve your use case (if you add multiple attributes with different assemblies??

@Thinspeed
Copy link
Author

Thinspeed commented May 19, 2025

I am implementing module monolith, each module is declared in saperate project and maps its endpoints and adds services with static abstract method. I am using CustomHandler so I cant add multiple attributes

@Dreamescaper
Copy link
Owner

Dreamescaper commented May 19, 2025

I am using CustomHandler so I cant add multiple attributes

Acutally, it should be possible to make it less restrictive. It shouldn't be allowed to mix CustomHandler and non-CustomHandler attributes on the same method, but should be nothing wrong if multiple CustomHandler attributes are present.

Would that solve your case?

@Thinspeed
Copy link
Author

i guess yes. but i am not sure that it will be more elegant

@Dreamescaper
Copy link
Owner

I understand your point.
Still, I'm a bit hesitant to add new filter properties, I don't want to end up with tens of properties, which are hard to maintain and are confusing to end users (e.g. does it make sense to add array counterpart for AssignableTo or AttributeFilter properties?).
Therefore, I'll put this PR on hold for now, and I'll create an issue for this functionality, and collect feedback how often it's going to be used.

In the meantime, I have published updated ServiceScan version, which allows multiple CustomHandlers attributes on the same method:
https://www.nuget.org/packages/ServiceScan.SourceGenerator/1.5.4

@Dreamescaper
Copy link
Owner

An alternative take is merged in #32 , therefore closing this PR.
Thanks for you collaboration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants