public ActionResult Save([FromBody] TimeModel item) { try { var task = _mapper.Map <Time>(item); var result = _service.Add(task); return(Ok(result)); } catch (Exception e) { Console.WriteLine(e); } return(BadRequest()); }
public ActionResult Criar(TimeVM model) { _timeService.Add(Mapper.Map<Time>(model)); return RedirectToAction("Index"); }