コード例 #1
0
        public async Task<HttpResponseMessage> Post(HorarioViewModel horario)
        {
            _horarioApp.Add(horario);
            var response = Request.CreateResponse(HttpStatusCode.OK, horario);

            var tsc = new TaskCompletionSource<HttpResponseMessage>();
            tsc.SetResult(response);
            return await tsc.Task;
        }
コード例 #2
0
 public HttpResponseMessage Put(HorarioViewModel horario)
 {
     _horarioApp.Add(horario);
     return Request.CreateResponse(HttpStatusCode.OK, "Horario Salvo com Sucesso");
 }