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

Proper TPL usage and dependency injection for ConsoleReferenceClient #1281

Merged

Conversation

lkomanetz
Copy link
Contributor

I wanted to make sure that anybody looking at the sample applications see proper TPL usage. Things like

  • Returning a Task for methods that do asynchronous work
  • Appending Async on methods that return Task.
  • Using GetAwaiter().GetResult() instead of Wait or Result
  • Making it "async all the way down."

I also decoupled dependencies to Console and response validation and passed those concepts in through constructor injection. Showing examples of creating more complicated things through composition instead of having tightly coupled dependencies.

Lastly I refactored the usage of String.Format to use string interpolation instead.

…se, and uses string interpolation versus String.Format.
@AlinMoldovean AlinMoldovean merged commit edec055 into OPCFoundation:master Feb 19, 2021
@lkomanetz lkomanetz deleted the reference_client_tpl_usage branch February 19, 2021 14:56
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.

None yet

2 participants