Ejemplo n.º 1
0
        // добавляем одного друга
        public async Task <TaskAnswers> AddTaskAnswers(TaskAnswers taskAnswers)
        {
            HttpClient client   = GetClient();
            var        response = await client.PostAsync(Url,
                                                         new StringContent(
                                                             JsonConvert.SerializeObject(taskAnswers),
                                                             Encoding.UTF8, "application/json"));

            if (response.StatusCode != System.Net.HttpStatusCode.OK)
            {
                return(null);
            }

            return(JsonConvert.DeserializeObject <TaskAnswers>(
                       await response.Content.ReadAsStringAsync()));
        }
 public async Task AddTaskAnswers(TaskAnswers taskAnswers)
 {
     TaskAnswersService tasksService = new TaskAnswersService();
     await tasksService.AddTaskAnswers(taskAnswers);
 }