示例#1
0
        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());
        }
示例#2
0
 public ActionResult Criar(TimeVM model)
 {
     _timeService.Add(Mapper.Map<Time>(model));
     return RedirectToAction("Index");
 }