I am registering delegate handler using unity during the initialization of webapi,during runtime i need to deregister the same handler,how can i achieve this? I am developing the application in c#
It would be helpful if you can update the question with some code which you have written to add the handler. Anyway to remove a handler you can simply use -= operator.
To Remove handler
backgroundWorker.DoWork -= mehtodName;
To Add handler I think you might be using something similar to below code to add the handler.?
backgroundWorker.DoWork += mehtodName;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.