I have few controllers that inherit from the same base class. Among the different actions that they don't share with each other, they do have a few that are completely identical. I would like to have these on my base class because they all work completely the same it's just that they're accessed through different routes.
How should I define these actions with several different routes?
My inherited classes also have a RoutePrefixAttribute
set on them so each of them is pointing to a different route.
Example
I have base abstract class called Vehicle
and then inherited Car
, Bike
, Bus
etc. All of them would have common action Move()
/bus/move
/car/move
/bike/move
How can I define action Move()
on my base class Vehicle
so that it will be executed on each subclass route?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…