Beispiel #1
0
        public async Task <CareHours> CreateAsync(CareHours careHours)
        {
            var uri = $"api/child/{careHours.ChildId}/Carehours";

            var responseStreamTask = await client.PostAsync(uri, careHoursSerializer.JsonHttpStringContent(careHours)).ContinueWith(t => t.Result.Content.ReadAsStreamAsync());

            return(careHours);
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("ChildId,StartTime,EndTime")] CareHours careHours)
        {
            if (ModelState.IsValid)
            {
                await _careHoursService.CreateAsync(careHours);

                return(RedirectToAction(nameof(ChildrenController.Details), "Children", new { id = careHours.ChildId }));
            }
            return(View());
        }
Beispiel #3
0
        public async Task DeleteAsync(CareHours careHours)
        {
            var uri = $"api/child/{careHours.ChildId}/Carehours/{careHours.EventId}";

            var responseStreamTask = await client.DeleteAsync(uri).ContinueWith(t => t.Result.Content.ReadAsStreamAsync());
        }