Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new helpful Entity Extensions #16457

Merged
merged 4 commits into from
Jul 19, 2024
Merged

Add new helpful Entity Extensions #16457

merged 4 commits into from
Jul 19, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented Jul 18, 2024

Adding the following helpful extensions to entity:

  • IEntity Alter<TAspect>(this IEntity entity, Action<TAspect> action)
  • bool TryGet<T>(this IEntity entity, out T aspect)

The new extensions simplify the following already existing extensions:

  • IEntity Alter<TAspect>(this IEntity entity, string name, Action<TAspect> action)
  • bool TryGet<T>(this IEntity entity, string name, out T aspect)

@MikeAlhayek MikeAlhayek requested a review from Piedone July 18, 2024 20:41
@Piedone
Copy link
Member

Piedone commented Jul 18, 2024

Any places in OC where these could be utilized?

@MikeAlhayek
Copy link
Member Author

@Piedone I used one of the new extensions in OC now. The TryGet was recently added and we still don't seems to use it in OC yet.

Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

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

Looks good, but please wait for the builds to finish. GitHub Actions has an issue right now where they're queued and their start is delayed: https://www.githubstatus.com/.

@MikeAlhayek MikeAlhayek enabled auto-merge (squash) July 18, 2024 23:50
@MikeAlhayek MikeAlhayek disabled auto-merge July 19, 2024 00:14
@MikeAlhayek MikeAlhayek enabled auto-merge (squash) July 19, 2024 00:16
@MikeAlhayek MikeAlhayek disabled auto-merge July 19, 2024 14:52
@MikeAlhayek MikeAlhayek enabled auto-merge (squash) July 19, 2024 14:53
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