(40)Take advantage of .NET 4.5 async constructsweb
招數40:數據庫
利用.NET 4.5異步結構網絡
With the arrival of .NET 4.5, writing async code correctly is easier than ever. Like any tool, it should be only applied where it makes most sense – in web use-cases this usually revolves around I/O operations (i.e. reading from disk, any network operation, database operations, or calls to web services).app
隨着.NET 4.5的到來,正確地編寫異步代碼比以往更容易。與其餘工具同樣,它應該只運用在最有意義的地方 - 在網絡用例上這一般圍繞着I/O操做(即:從磁盤讀取,一些網絡操做,數據庫操做,或調用Web服務)。異步