GetCarsAsync() public method

public GetCarsAsync ( ) : Task>
return Task>
コード例 #1
0
        public ViewResult CarsSync() {

            SampleAPIClient client = new SampleAPIClient();
            var cars = client.GetCarsAsync().Result;

            return View("Index", model: cars);
        }
コード例 #2
0
        public async Task<ViewResult> CarsAsync() {

            SampleAPIClient client = new SampleAPIClient();
            var cars = await client.GetCarsAsync();

            return View("Index", model: cars);
        }