I have simple (as i think) logic.
public static void NotifyAboutNewJob(int jobId, bool forceSending = false)
{
Action<int> notifier = SendAppleNotifications;
notifier.BeginInvoke(jobId, null, null);
}
Method SendAppleNotifications had one parametera and it was easy to pass it into BeginInvoke
. Now i have added second parameter forceSending
. And problem - i don't know how to pass it into BeginInvoke
.
Should i pass it as 3rd param as object
?
private static void SendAppleNotifications(int jobId, bool forceSending = false){...}
Or this is the answer :
Action<int, bool> notifier = SendAppleNotifications;
notifier.BeginInvoke(jobId, forceSending, null, null);
Change your Action<int>
to Action<int, bool>
Action<int, bool> notifier = SendAppleNotifications;
notifier.BeginInvoke(jobId, forceSending, null, null); // You can now pass true or false as 2nd parameter.
then it should work ok.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With