Пример #1
0
        public async Task CreateTextoAsync(TextoHomeViewModel textoHomeViewModel)
        {
            _unitOfWork.BeginTransaction();
            await _textoHomeServices.CreateAsync(_mapper.Map <TextoHomeModel>(textoHomeViewModel));

            await _unitOfWork.CommitAsync();
        }
Пример #2
0
        public async Task <IActionResult> AdicionarTextoTopHome(TextoHomeViewModel textoHomeViewModel)
        {
            try
            {
                await _homeAppServices.CreateTextoAsync(textoHomeViewModel);

                TempData["Success"] = "Adicionado com sucesso";
            }
            catch (Exception)
            {
                TempData["Error"] = "Erro ao adicionar texto";
            }


            return(RedirectToAction("EditTextos", "Home"));
        }