コード例 #1
0
		public async Task DoStuff(IAsyncModel model)
		{
			await Task.Factory.StartNew(() => Thread.Sleep(5));
			// continuation begins here
			var result = model.GetData();
			if (result != 5)
			{
				throw new Exception();
			}
		}
コード例 #2
0
        public async Task DoStuff(IAsyncModel model)
        {
            await Task.Factory.StartNew(() => Thread.Sleep(5));

            // continuation begins here
            var result = model.GetData();

            if (result != 5)
            {
                throw new Exception();
            }
        }