- Introduced in
.Net 4.5
- The method signature includes an
async
modifier. - The name of an
async
method, by convention, ends with anAsync
suffix. - The return type is one of the following types:
Task<TResult>
if your method has a return statement in which the operand has typeTResult
.Task
if your method has no return statement or has a return statement with no operand.void
if you're writing anasync
event 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
await
expression, 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
async
method eventually completes its work, the task is marked as completed and the result, if any, is stored in the task. - The
async
andawait
keywords 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() | |
{ |