Ejemplo n.º 1
0
        public static async Task ValidateMercadoLivreId(long id)
        {
            try
            {
                var exists = await AccountDAO.CheckIfMercadoLivreIdExists(id);

                if (!exists)
                {
                    throw new Exception("Conta nao sincronizada na base de dados");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static async Task ValidateNew(long id)
        {
            try
            {
                var idAlreadyExistInDb = await AccountDAO.CheckIfMercadoLivreIdExists(id);

                if (idAlreadyExistInDb)
                {
                    throw new CustomExceptions.InvalidOperationException("Essa conta já está sincronizada.");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }