[Feature] EventHandler as [Attribute]
See original GitHub issueI was recently checking out Dapr, and saw this really interested and simple way to invoke event handlers
[Topic("pubsub", "newOrder")]
[HttpPost("/orders")]
public async Task<ActionResult> CreateOrder(Order order)
Simply adding the Topic
attribute.
At the moment I am doing a lot of Event Driven stuff with ABP and I am finding the overhead in creating a handler for every action a bit much, it would be nice to just have a service with all the functions in for a specific domain, and then I can just append a [AsyncHandles<ISomeEventData>]
or even go one further and perhaps even throw a resolver in there
[AsyncHandles<ISomeEventData, Order>((edata, orderRepo) => return orderRepo.Get(edata.orderId))]
and then the function below would be provided the order directly.
I am still fairly new to EDD so I may not be going the most productive way about it, but I just think it would be a nice addition to ABP.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
@worthy7 sorry for my late reply. You can create an Interceptor and achieve this in your application. However, we don’t want to create new interceptors in the framework itself because it causes performance problems.
thanks very much