private async Task <bool> SaveAsync()
        {
            _dataInput = Input;
            var valor = false;

            if (ModelState.IsValid)
            {
                var strategy = _context.Database.CreateExecutionStrategy();
                await strategy.ExecuteAsync(async() =>
                {
                    using (var transaction = _context.Database.BeginTransaction())
                    {
                        try
                        {
                            var imageByte = await _uploadimage.ByteAvatarImageAsync(
                                Input.AvatarImage, _environment, "images/images/default.png");
                            var post = new TPosts
                            {
                                Titulo        = Input.Titulo,
                                Contenido     = Input.Contenido,
                                Image         = imageByte,
                                Categoria     = Input.Categoria,
                                FechaCreacion = DateTime.Now,
                                PostActivo    = 1,
                            };
                            await _context.AddAsync(post);
                            _context.SaveChanges();
                            transaction.Commit();
                            _dataInput = null;
                            valor      = true;
                        }
                        catch (Exception ex)
                        {
                            _dataInput.ErrorMessage = ex.Message;
                            transaction.Rollback();
                            valor = false;
                        }
                    }
                });
            }
            else
            {
                foreach (var modelState in ModelState.Values)
                {
                    foreach (var error in modelState.Errors)
                    {
                        _dataInput.ErrorMessage += error.ErrorMessage;
                    }
                }
                valor = false;
            }
            return(valor);
        }