示例#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 ActionResult Criar(HorariosViewModel horario)
 {
     if (ModelState.IsValid)
     {
         var horarioDomain = Mapper.Map <HorariosViewModel, Horarios>(horario);
         _horarioApp.Add(horarioDomain);
         return(RedirectToAction("Index"));
     }
     ViewBag.ColaboradorId = new SelectList(_colaboradorApp.GetAll(), "ColaboraforId", "Nome", horario.ColaboradorId);
     return(View(horario));
 }