예제 #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);
        }