- Introduced in
.Net 4.5 - The method signature includes an
asyncmodifier. - The name of an
asyncmethod, by convention, ends with anAsyncsuffix. - The return type is one of the following types:
Task<TResult>if your method has a return statement in which the operand has typeTResult.Taskif your method has no return statement or has a return statement with no operand.voidif you're writing anasyncevent handler. This return type is used primarily to define event handlers, where a void return type is required.
- The method usually includes at least one
awaitexpression, which marks a point where the method can't continue until the awaited asynchronous operation is complete. In the meantime, the method is suspended, and control returns to the method's caller. - When the
asyncmethod eventually completes its work, the task is marked as completed and the result, if any, is stored in the task. - The
asyncandawaitkeywords don't cause additional threads to be
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| console.log('iife triggered'); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your **location** block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # As of Nginx 1.7.5, add_header supports an "always" parameter which |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface IAPIProvider | |
| { | |
| void SearchHotels(); | |
| void GetHotelDetails(); | |
| void GetRoomDetails(); | |
| void GetCancellationPolicies(); | |
| void GetExtraGuestChargeDetails(); | |
| void BlockRoom(); | |
| void BookRoom(); | |
| void GetBookingDetails(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // References | |
| // 1. http://www.dofactory.com/reference/csharp-coding-standards | |
| // 2. Modifications as per our usage | |
| // 1. do use PascalCasing for class names and method names. | |
| // -------------------------------------------------------- | |
| public class ClientActivity | |
| { | |
| public void ClearStatistics() | |
| { |