Skip to content

Conversation

@b4ry
Copy link
Contributor

@b4ry b4ry commented Mar 4, 2020

Summary

  • added a bit of clarification to the set of delegate types (if they return a value or not),
  • fixed a typo

I did not create an issue since it does not look like one - just more like clarification.

- added a bit of clarification to the set of delegate types,
- fixed a typo
@b4ry b4ry requested a review from gewarren as a code owner March 4, 2020 17:26
@dotnet-bot dotnet-bot added this to the March 2020 milestone Mar 4, 2020
* `Action<>` is used when there is a need to perform an action using the arguments of the delegate.
* `Func<>` is used usually when you have a transformation on hand, that is, you need to transform the arguments of the delegate into a different result. Projections are a prime example of this.
* `Predicate<>` is used when you need to determine if the argument satisfies the condition of the delegate. It can also be written as a `Func<T, bool>`.
* `Action<>` is used when there is a need to perform an action using the arguments of the delegate. The method it encapsulates does not return a value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea to add the return values to the definitions here. I'm not 100% sure that "encapsulates" is technically accurate, since the method is assigned to the delegate type. @BillWagner Can you comment if "encapsulates" is correct here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren
Yes, I agree that we need some more insight into that if it creates confusion. To be honest, I was using msdn docs referring to these particular delegates :).

- review changes regarding Predicate<> delegate

Co-Authored-By: Genevieve Warren <[email protected]>
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will go ahead and merge this now. Thanks again!

@gewarren gewarren merged commit ea6dfd7 into dotnet:master Mar 27, 2020
@b4ry b4ry deleted the patch-1 branch March 28, 2020 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants