Пример #1
0
        public Editora Adicionar(Editora obj)
        {
            BeginTransaction();
            var returno = _editoraService.Adicionar(obj);

            Commit();

            return(returno);
        }
Пример #2
0
        public async Task <IActionResult> Create(EditoraViewModel editoraViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(editoraViewModel));
            }

            var editora = _mapper.Map <Editora>(editoraViewModel);
            await _editoraService.Adicionar(editora);

            if (!OperacaoValida())
            {
                return(View(editoraViewModel));
            }

            return(RedirectToAction("Index"));
        }