✅ Apply multiple attributes from custom attribute
Hey. I want to encapsulate some duplicated logic from a custom attribute. Right now I'm decorating endpoints with multiple attributes, and I'd like to be apply to just apply my own custom attribute, and have that attribute apply multiple other attributes.
So my custom attribute would look like this(?):
6 Replies
no you can't
but aspnet core generally works with interfaces and not the concrete attributes
you can implement those in yours
look at what interfaces those attributes implement
also you can apply those to the controller
people generally make a controller base class with these
I second @Anton 's base controller approach. Always worked great for me when I was still working with controllers.
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Sorry, I didn't see oyur message until now. Seems it got closed for me. Thanks!