public JsonResult Post([FromBody] Menu Menu) { _service.Add(Menu); return(new JsonResult(new { code = 20000 })); }
public async Task <HttpResponseMessage> Post([FromBody] Menu menu) { try { await _menuAppService.Add(menu); NotificationHub.SendMessageNew(string.Format("Menu Cadastrado com Sucesso {0}", Guid.NewGuid())); return(await Task.Factory.StartNew(() => new HttpResponseMessage { StatusCode = HttpStatusCode.OK })); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <long> > Add([FromBody] MenuSaveInputDto menuDto) { return(CreatedResult(await _menuService.Add(menuDto))); }
public MenuViewModel Post([FromBody] MenuViewModel menu) { menu = _menuAppService.Add(menu); menu.AddRangeLink(_menuEnricher.CreateLinks(Method.Post, menu)); return(menu); }