Getting all results from Func call

后端 未结 3 934
逝去的感伤
逝去的感伤 2021-01-24 17:34

The concept of delegates aren\'t too new to me but I cannot seem to find out how to get all results from a Func delegates. More specifically, I have a class that has a Func dele

3条回答
  •  不知归路
    2021-01-24 17:45

    A quick search on MSDN found this thread:

    https://social.msdn.microsoft.com/Forums/en-US/38a638fe-4a7d-44d6-876c-729d90c20737/how-to-get-return-value-from-delegate?forum=csharplanguage

    The problem with events is that the return values cannot be fully trusted. You will get only one return value no matter how many subscribers that you have for the event. The central issue is that you cannot reliably determine which subscriber produced the return value. The beauty of the .NET Event Model is the anonymity that it uses. That means event subscribers are completely abstracted from the event publishers.

提交回复
热议问题