Esempio n. 1
0
        public IActionResult Post([FromBody] CardBrandViewModel CardBrandViewModel)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(CardBrandViewModel));
            }

            _CardBrandAppService.Register(CardBrandViewModel);

            return(Response(CardBrandViewModel));
        }
        public IActionResult Create(CardBrandViewModel cardBrandViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(cardBrandViewModel));
            }
            _cardBrandAppService.Register(cardBrandViewModel);

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

            return(View(cardBrandViewModel));
        }