Replies: 1 comment 1 reply
-
Hi :) One way to share a common action between these controllers without repeating yourself is to use an interface or an abstract base class that defines this common action.
In this way, both CustomerController and OrderController have the CommonAction method, and you can call it on any instance of these classes that you know implements ICommonAction. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say we have a generic base class:
Then we inherit two controllers from this
ListController
and
Now let's say I have a common action, that can not be put inside the
ListController
. How do you share that action between these controllers without repeating yourself?Beta Was this translation helpful? Give feedback.
All reactions