Пример #1
0
 public JsonResult Post([FromBody] Menu Menu)
 {
     _service.Add(Menu);
     return(new JsonResult(new
     {
         code = 20000
     }));
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public async Task <ActionResult <long> > Add([FromBody] MenuSaveInputDto menuDto)
 {
     return(CreatedResult(await _menuService.Add(menuDto)));
 }
Пример #4
0
 public MenuViewModel Post([FromBody] MenuViewModel menu)
 {
     menu = _menuAppService.Add(menu);
     menu.AddRangeLink(_menuEnricher.CreateLinks(Method.Post, menu));
     return(menu);
 }