Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Sede")] Editoriales editorial)
        {
            if (ModelState.IsValid)
            {
                await _client.Create(editorial);

                return(RedirectToAction(nameof(Index)));
            }

            return(View(editorial));
        }
Esempio n. 2
0
        public async Task <Editoriales> SaveEditorial(Editoriales editorial)
        {
            _logger.LogDebug("Editoriales client created, request = GetById{@id}", editorial.Id);
            var _editorial = await _editoriales.GetById(editorial.Id);

            _logger.LogDebug("Editoriales response {@response}", _editorial);

            if (_editorial is null)
            {
                _logger.LogDebug("Editoriales client created, request = Create{@editorial}", editorial);
                _editorial = await _editoriales.Create(editorial);

                _logger.LogDebug("Editoriales response {@response}", _editorial);
            }
            else
            {
                _logger.LogDebug("Editoriales client created, request = Update{@editorial}", editorial);
                _editorial = await _editoriales.Update(editorial);

                _logger.LogDebug("Editoriales response {@response}", _editorial);
            }

            return(_editorial);
        }