示例#1
0
        public IActionResult Put([FromBody] BongViewModel BongViewModel)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(BongViewModel));
            }

            _BongAppService.Update(BongViewModel);

            return(Response(BongViewModel));
        }
示例#2
0
        public IActionResult Create(BongViewModel BongViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(BongViewModel));
            }
            _BongAppService.Register(BongViewModel);

            if (IsValidOperation())
            {
                ViewBag.Sucesso = "Bong Registered!";
            }

            return(View(BongViewModel));
        }
示例#3
0
        public IActionResult Edit(BongViewModel BongViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(BongViewModel));
            }

            _BongAppService.Update(BongViewModel);

            if (IsValidOperation())
            {
                ViewBag.Sucesso = "Bong Updated!";
            }

            return(View(BongViewModel));
        }
        public void Update(BongViewModel BongViewModel)
        {
            var updateCommand = _mapper.Map <UpdateBongCommand>(BongViewModel);

            Bus.SendCommand(updateCommand);
        }
        public void Register(BongViewModel BongViewModel)
        {
            var registerCommand = _mapper.Map <RegisterNewBongCommand>(BongViewModel);

            Bus.SendCommand(registerCommand);
        }