April 2018
Intermediate to advanced
300 pages
7h 41m
English
The out and ref parameters are not allowed as parameters in the method signature. If multiple values need to be returned, tuples or a custom data structure can be used. The method should always return Task or Task<TResult>, as discussed previously.
Here are a few signatures for both synchronous and asynchronous methods:
|
Synchronous method |
Asynchronous method |
|
Void Execute(); |
Task ExecuteAsync(); |
|
List<string> GetCountries(); |
Task<List<string>> GetCountriesAsync(); |
|
Tuple<int, string> GetState(int stateID); |
Task<Tuple<int, string>> GetStateAsync(int stateID); |
|
Person GetPerson(int personID); |
Task<Person> GetPersonAsync(int personID); |
Read now
Unlock full access