diff --git a/.github/workflows/basket-api.yml b/.github/workflows/basket-api.yml new file mode 100644 index 0000000000..9d26853824 --- /dev/null +++ b/.github/workflows/basket-api.yml @@ -0,0 +1,92 @@ +name: basket-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Basket/** + - .github/workflows/basket-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Basket/** + - .github/workflows/basket-api.yml +env: + SERVICE: basket-api + IMAGE: basket.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/catalog-api.yml b/.github/workflows/catalog-api.yml new file mode 100644 index 0000000000..ca05a56ea4 --- /dev/null +++ b/.github/workflows/catalog-api.yml @@ -0,0 +1,92 @@ +name: catalog-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Catalog/** + - .github/workflows/catalog-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Catalog/** + - .github/workflows/catalog-api.yml +env: + SERVICE: catalog-api + IMAGE: catalog.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/identity-api.yml b/.github/workflows/identity-api.yml new file mode 100644 index 0000000000..b57c8151b3 --- /dev/null +++ b/.github/workflows/identity-api.yml @@ -0,0 +1,92 @@ +name: identity-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Identity/** + - .github/workflows/identity-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Identity/** + - .github/workflows/identity-api.yml +env: + SERVICE: identity-api + IMAGE: identity.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/mobileshoppingagg.yml b/.github/workflows/mobileshoppingagg.yml new file mode 100644 index 0000000000..2de0c0370c --- /dev/null +++ b/.github/workflows/mobileshoppingagg.yml @@ -0,0 +1,90 @@ +name: mobileshoppingagg + +on: + push: + branches: + - dev + + paths: + - src/ApiGateways/Mobile.Bff.Shopping/aggregator/** + - .github/workflows/mobileshoppingagg.yml + + pull_request: + branches: + - dev + + paths: + - src/ApiGateways/Mobile.Bff.Shopping/aggregator/** + - .github/workflows/mobileshoppingagg.yml +env: + SERVICE: mobileshoppingagg + IMAGE: mobileshoppingagg + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/ordering-api.yml b/.github/workflows/ordering-api.yml new file mode 100644 index 0000000000..5adec0760f --- /dev/null +++ b/.github/workflows/ordering-api.yml @@ -0,0 +1,92 @@ +name: ordering-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-api.yml +env: + SERVICE: ordering-api + IMAGE: ordering.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/ordering-backgroundtasks.yml b/.github/workflows/ordering-backgroundtasks.yml new file mode 100644 index 0000000000..f8f7badfae --- /dev/null +++ b/.github/workflows/ordering-backgroundtasks.yml @@ -0,0 +1,92 @@ +name: ordering-backgroundtasks + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-backgroundtasks.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-backgroundtasks.yml +env: + SERVICE: ordering-backgroundtasks + IMAGE: ordering.backgroundtasks + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/ordering-signalrhub.yml b/.github/workflows/ordering-signalrhub.yml new file mode 100644 index 0000000000..564a814581 --- /dev/null +++ b/.github/workflows/ordering-signalrhub.yml @@ -0,0 +1,92 @@ +name: ordering-signalrhub + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-signalrhub.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Ordering/** + - .github/workflows/ordering-signalrhub.yml +env: + SERVICE: ordering-signalrhub + IMAGE: ordering.signalrhub + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/payment-api.yml b/.github/workflows/payment-api.yml new file mode 100644 index 0000000000..3cd18756f9 --- /dev/null +++ b/.github/workflows/payment-api.yml @@ -0,0 +1,92 @@ +name: payment-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Payment/** + - .github/workflows/payment-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Payment/** + - .github/workflows/payment-api.yml +env: + SERVICE: payment-api + IMAGE: payment.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webhooks-api.yml b/.github/workflows/webhooks-api.yml new file mode 100644 index 0000000000..f39599d40f --- /dev/null +++ b/.github/workflows/webhooks-api.yml @@ -0,0 +1,92 @@ +name: webhooks-api + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Webhooks/** + - .github/workflows/webhooks-api.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Services/Webhooks/** + - .github/workflows/webhooks-api.yml +env: + SERVICE: webhooks-api + IMAGE: webhooks.api + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webhooks-client.yml b/.github/workflows/webhooks-client.yml new file mode 100644 index 0000000000..6851921feb --- /dev/null +++ b/.github/workflows/webhooks-client.yml @@ -0,0 +1,92 @@ +name: webhooks-client + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebhookClient/** + - .github/workflows/webhooks-client.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebhookClient/** + - .github/workflows/webhooks-client.yml +env: + SERVICE: webhooks-client + IMAGE: webhooks.client + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webmvc.yml b/.github/workflows/webmvc.yml new file mode 100644 index 0000000000..9fc0cdf86e --- /dev/null +++ b/.github/workflows/webmvc.yml @@ -0,0 +1,93 @@ +name: webmvc + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebMVC/** + - .github/workflows/webmvc.yml + + pull_request: + branches: + - dev + paths: + + - src/BuildingBlocks/** + - src/Web/WebMVC/** + - .github/workflows/webmvc.yml + +env: + SERVICE: webmvc + IMAGE: webmvc + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webshoppingagg.yml b/.github/workflows/webshoppingagg.yml new file mode 100644 index 0000000000..6c6df5dbb6 --- /dev/null +++ b/.github/workflows/webshoppingagg.yml @@ -0,0 +1,90 @@ +name: webshoppingagg + +on: + push: + branches: + - dev + + paths: + - src/ApiGateways/Web.Bff.Shopping/aggregator/** + - .github/workflows/webshoppingagg.yml + + pull_request: + branches: + - dev + + paths: + - src/ApiGateways/Web.Bff.Shopping/aggregator/** + - .github/workflows/webshoppingagg.yml +env: + SERVICE: webshoppingagg + IMAGE: webshoppingagg + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webspa.yml b/.github/workflows/webspa.yml new file mode 100644 index 0000000000..3dbc3c496b --- /dev/null +++ b/.github/workflows/webspa.yml @@ -0,0 +1,92 @@ +name: webspa + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebSPA/** + - .github/workflows/webspa.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebSPA/** + - .github/workflows/webspa.yml +env: + SERVICE: webspa + IMAGE: webspa + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.github/workflows/webstatus.yml b/.github/workflows/webstatus.yml new file mode 100644 index 0000000000..05d941cf29 --- /dev/null +++ b/.github/workflows/webstatus.yml @@ -0,0 +1,93 @@ +name: webstatus + +on: + push: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebStatus/** + - .github/workflows/webstatus.yml + + pull_request: + branches: + - dev + + paths: + - src/BuildingBlocks/** + - src/Web/WebStatus/** + - .github/workflows/webstatus.yml + +env: + SERVICE: webstatus + IMAGE: webstatus + +jobs: + + BuildContainersForPR_Linux: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + BuildLinux: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' }} + steps: + - name: 'Checkout Github Action' + uses: actions/checkout@master + + - name: Enable experimental features for the Docker daemon and CLI + run: | + echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json + mkdir -p ~/.docker + echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json + sudo service docker restart + docker version -f '{{.Client.Experimental}}' + docker version -f '{{.Server.Experimental}}' + + - name: Login to Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ secrets.REGISTRY_HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + + - name: Set branch name as env variable + run: | + currentbranch=$(echo ${GITHUB_REF##*/}) + echo "running on $currentbranch" + echo "BRANCH=$currentbranch" >> $GITHUB_ENV + shell: bash + + - name: Compose build ${{ env.SERVICE }} + run: sudo -E docker-compose build ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Compose push ${{ env.SERVICE }} + run: sudo -E docker-compose push ${{ env.SERVICE }} + working-directory: ./src + shell: bash + env: + TAG: ${{ env.BRANCH }} + REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} + + - name: Create multiarch manifest + run: | + docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }} + docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} + shell: bash \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2be2528096..587a6e0a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +## Local history files +.history/ +.vshistory/ + # User-specific files *.suo *.user diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0ff17a325..ccb80afb81 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ This repo is a reference and learning resource and everyone is invited to contribute, however not all PRs will be accepted into the main branch (**`dev`**). -There's a general development strategy that's driven by @CESARDELATORRE, who chooses, or defines criteria for choosing, the issues to include in the codebase, given a bunch of constraints and other guidelines. +There's a general development strategy that's driven by @CESARDELATORRE/@nishanil, who chooses, or defines criteria for choosing, the issues to include in the codebase, given a bunch of constraints and other guidelines. However you can always get in touch with him, if you want to implement some general-interest feature in your repo and have it referenced from the [documentation](https://docs.microsoft.com/dotnet/standard/microservices-architecture/) or the [Microservices eBook](https://aka.ms/microservicesebook/). @@ -47,15 +47,14 @@ All contributions must be submitted as a [Pull Request (PR)](https://help.github The main branches are **`dev`** and **`master`**: - **`dev`**: Contains the latest code **and it is the branch actively developed**. -**All PRs must be against `dev` branch to be considered**. This branch is developed using .NET Core 2.x +**All PRs must be against `dev` branch to be considered**. This branch is developed using `.NET 5` -- **`master`**: Synced from time to time from **`dev`**. It contains "stable" code. -(**Keep in mind "stable" does not mean PRODUCTION-READY!**) +- **`main`**: Synced from time to time from **`dev`**. It contains "stable" code.This branch contains changes specific to `.NET Core 3.1` (**Keep in mind "stable" does not mean PRODUCTION-READY!**) - Any other branch is considered temporary and could be deleted at any time. Do not submit any PR to them! ## DISCLAIMER - This is not a PRODUCTION-READY TEMPLATE for microservices -eShopOnContainers is a reference application to **showcase architectural patterns** for developing microservices applications on .NET Core. **IT IS NOT A PRODUCTION-READY TEMPLATE** to start real-world application. In fact, the application is in a **permanent beta state**, as it’s also used to test new potentially interesting technologies as they show up. +eShopOnContainers is a reference application to **showcase architectural patterns** for developing microservices applications on .NET 5. **IT IS NOT A PRODUCTION-READY TEMPLATE** to start real-world application. In fact, the application is in a **permanent beta state**, as it’s also used to test new potentially interesting technologies as they show up. Since this is a learning resource, some design decisions have favored simplicity to convey a pattern, over production-grade robustness. diff --git a/README.md b/README.md index e457ff9ea9..2ea2b7982e 100644 --- a/README.md +++ b/README.md @@ -8,18 +8,16 @@ Sample .NET Core reference application, powered by Microsoft, based on a simplif ![](img/eshop-webmvc-app-screenshot.png) -## Azure DevOps - Build Status +## Build Status (GitHub Actions) | Image | Status | Image | Status | | ------------- | ------------- | ------------- | ------------- | -| Api Gateway (base) | [![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev) | Shopping Aggregator (Web) | [![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) | -| Basket API | [![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev) | Shopping Aggregator (Mobile) | [![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) | -| Catalog API | [![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev) | Web Client (MVC) | [![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) | -|Identity API | [![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev) | Web Client (SPA) | [![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) | -| Location API | [![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev) | Web Status (Health) | [![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) | -| Marketing API | [![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev) | Webhooks API | [![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) | -| Ordering API | [![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev) | Webhooks Client | [![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) | -| Payment API | [![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev) | | | +| Web Status | [![Web Status](https://github.com/dotnet-architecture/eShopOnContainers/workflows/webstatus/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Awebstatus) | Shopping Aggregator (Web) | [![Web Shopping Aggregator](https://github.com/dotnet-architecture/eShopOnContainers/workflows/webshoppingagg/badge.svg)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Awebshoppingagg) | +| Basket API | [![Basket API](https://github.com/dotnet-architecture/eShopOnContainers/workflows/basket-api/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Abasket-api) | Shopping Aggregator (Mobile) | [![Mobile Shopping Aggregator](https://github.com/dotnet-architecture/eShopOnContainers/workflows/mobileshoppingagg/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Amobileshoppingagg) | +| Catalog API | [![Catalog API](https://github.com/dotnet-architecture/eShopOnContainers/workflows/catalog-api/badge.svg)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Acatalog-api) | Web Client (MVC) | [![WebMVC Client](https://github.com/dotnet-architecture/eShopOnContainers/workflows/webmvc/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Awebmvc) | +|Identity API | [![Identity API](https://github.com/dotnet-architecture/eShopOnContainers/workflows/identity-api/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Aidentity-api) | Web Client (SPA) | [![WebSPA Client](https://github.com/dotnet-architecture/eShopOnContainers/workflows/webspa/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Awebspa) | +| Ordering API | [![Ordering API](https://github.com/dotnet-architecture/eShopOnContainers/workflows/ordering-api/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Aordering-api) | Webhooks Client | [![Webhooks demo client](https://github.com/dotnet-architecture/eShopOnContainers/workflows/webhooks-client/badge.svg)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Awebhooks-client) | +| Payment API | [![Payment API](https://github.com/dotnet-architecture/eShopOnContainers/workflows/payment-api/badge.svg?branch=dev)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Apayment-api) | Ordering SignalR | [![Ordering SignalR](https://github.com/dotnet-architecture/eShopOnContainers/workflows/ordering-signalrhub/badge.svg)](https://github.com/dotnet-architecture/eShopOnContainers/actions?query=workflow%3Aordering-signalrhub) | | _**Dev** branch contains the latest **beta** code and their images are tagged with `:linux-dev` in our [Docker Hub](https://hub.docker.com/u/eshop)_ @@ -72,9 +70,9 @@ In the future more features will be implemented in the advanced scenario. **NEWS / ANNOUNCEMENTS** Do you want to be up-to-date on .NET Architecture guidance and reference apps like eShopOnContainers? --> Subscribe by "WATCHING" this new GitHub repo: https://github.com/dotnet-architecture/News -## Updated for .NET Core 3.1 (LTS) +## Updated for .NET 5 -eShopOnContainers is updated to .NET Core 3.1 "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions with several significant changes. +eShopOnContainers is updated to .NET 5 "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions with several significant changes. **See more details in the [Release notes](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Release-notes) wiki page**. @@ -86,7 +84,7 @@ eShopOnContainers is updated to .NET Core 3.1 "wave" of technologies. Not just ### Architecture overview -This reference application is cross-platform at the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps. +This reference application is cross-platform at the server and client side, thanks to .NET 5 services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps. The architecture proposes a microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the [roadmap](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Roadmap). ![](img/eshop_logo.png) diff --git a/branch-guide.md b/branch-guide.md index 386e74ee55..040d9bab42 100644 --- a/branch-guide.md +++ b/branch-guide.md @@ -2,9 +2,9 @@ Following are the most important branches: -- `dev`: Contains the latest code **and it is the branch actively developed**. Note that **all PRs must be against `dev` branch to be considered**. This branch is developed using .NET Core 2.0 -- `master`: Synced time to time from dev. It contains "stable" code, although not the latest one. We plan to do periodic merges from `dev` to `master`, but we are not doing it right now. +- `dev`: Contains the latest code **and it is the branch actively developed**. Note that **all PRs must be against the `dev` branch to be considered**. This branch is developed using `.NET 5` +- `main`: Synced time to time from `dev`.It contains "stable" code, although not the latest one. Right now, this branch contains changes specific to `.NET Core 3.1` -Any other branch is considered temporary and could be deleted at any time. Do not do any PR to them! +Any other branch is considered temporary and could be deleted at any time. Do not submit any PR against them! Thanks! diff --git a/build/acr-build/queue-all.ps1 b/build/acr-build/queue-all.ps1 index 69448f9a20..d160abfc14 100644 --- a/build/acr-build/queue-all.ps1 +++ b/build/acr-build/queue-all.ps1 @@ -14,12 +14,10 @@ $services = @( @{ Name="eshopidentity"; Image="eshop/identity.api"; File="src/Services/Identity/Identity.API/Dockerfile" }, @{ Name="eshopordering"; Image="eshop/ordering.api"; File="src/Services/Ordering/Ordering.API/Dockerfile" }, @{ Name="eshoporderingbg"; Image="eshop/ordering.backgroundtasks"; File="src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile" }, - @{ Name="eshopmarketing"; Image="eshop/marketing.api"; File="src/Services/Marketing/Marketing.API/Dockerfile" }, @{ Name="eshopwebspa"; Image="eshop/webspa"; File="src/Web/WebSPA/Dockerfile" }, @{ Name="eshopwebmvc"; Image="eshop/webmvc"; File="src/Web/WebMVC/Dockerfile" }, @{ Name="eshopwebstatus"; Image="eshop/webstatus"; File="src/Web/WebStatus/Dockerfile" }, @{ Name="eshoppayment"; Image="eshop/payment.api"; File="src/Services/Payment/Payment.API/Dockerfile" }, - @{ Name="eshoplocations"; Image="eshop/locations.api"; File="src/Services/Location/Locations.API/Dockerfile" }, @{ Name="eshopocelotapigw"; Image="eshop/ocelotapigw"; File="src/ApiGateways/ApiGw-Base/Dockerfile" }, @{ Name="eshopmobileshoppingagg"; Image="eshop/mobileshoppingagg"; File="src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile" }, @{ Name="eshopwebshoppingagg"; Image="eshop/webshoppingagg"; File="src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile" }, diff --git a/build/azure-devops/apigws/azure-pipelines.yml b/build/azure-devops/apigws/azure-pipelines.yml deleted file mode 100644 index f2399b3412..0000000000 --- a/build/azure-devops/apigws/azure-pipelines.yml +++ /dev/null @@ -1,32 +0,0 @@ -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/ApiGateways/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/apigws/* - - deploy/k8s/helm/apigwmm/* - - deploy/k8s/helm/apigwms/* - - deploy/k8s/helm/apigwwm/* - - deploy/k8s/helm/apigwws/* - exclude: - - src/ApiGateways/Mobile.Bff.Shopping/aggregator/* - - src/ApiGateways/Web.Bff.Shopping/aggregator/* -jobs: -- job: PublishCharts - condition: ne('$(Build.Reason)', 'PullRequest') - pool: - vmImage: 'ubuntu-16.04' - steps: - - task: CopyFiles@2 - inputs: - sourceFolder: $(Build.SourcesDirectory)/deploy/k8s/helm - targetFolder: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm - artifactName: helm diff --git a/build/azure-devops/basket-api/azure-pipelines.yml b/build/azure-devops/basket-api/azure-pipelines.yml deleted file mode 100644 index 8aa99a9be1..0000000000 --- a/build/azure-devops/basket-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Basket/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/basket-api/* - - deploy/k8s/helm/basket-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: basket-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: basket.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/buildimages.yaml b/build/azure-devops/buildimages.yaml deleted file mode 100644 index 2e58cad21a..0000000000 --- a/build/azure-devops/buildimages.yaml +++ /dev/null @@ -1,94 +0,0 @@ -parameters: - services: '' - registryEndpoint: '' - helmfrom: '' - helmto: '' - -jobs: -- job: BuildContainersForPR_Linux - condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest') - pool: - vmImage: 'ubuntu-16.04' - steps: - - bash: docker-compose -f src/docker-compose.yml build ${{ parameters.services }} - displayName: Compose build ${{ parameters.services }} - env: - TAG: ${{ variables['Build.SourceBranchName'] }} -- job: BuildContainersForPR_Windows - condition: False - # condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest') - pool: - vmImage: 'windows-2019' - steps: - - bash: docker-compose f src/docker-compose.yml build ${{ parameters.services }} - displayName: Compose build ${{ parameters.services }} - env: - TAG: ${{ variables['Build.SourceBranchName'] }} - PLATFORM: win - NODE_IMAGE: stefanscherer/node-windows:10 -- job: BuildLinux - condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest') - pool: - vmImage: 'ubuntu-16.04' - steps: - - task: DockerCompose@0 - displayName: Compose build ${{ parameters.services }} - inputs: - dockerComposeCommand: 'build ${{ parameters.services }}' - containerregistrytype: Container Registry - dockerRegistryEndpoint: ${{ parameters.registryEndpoint }} - dockerComposeFile: src/docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=${{ variables['Build.SourceBranchName'] }} - - task: DockerCompose@0 - displayName: Compose push ${{ parameters.images }} - inputs: - dockerComposeCommand: 'push ${{ parameters.services }}' - containerregistrytype: Container Registry - dockerRegistryEndpoint: ${{ parameters.registryEndpoint }} - dockerComposeFile: src/docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=${{ variables['Build.SourceBranchName'] }} - - task: CopyFiles@2 - inputs: - sourceFolder: ${{ parameters.helmfrom }} - targetFolder: ${{ parameters.helmto }} - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: ${{ parameters.helmto }} - artifactName: helm -- job: BuildWindows - condition: False - # condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest') - pool: - vmImage: 'windows-2019' - steps: - - task: DockerCompose@0 - displayName: Compose build ${{ parameters.services }} - inputs: - dockerComposeCommand: 'build ${{ parameters.services }}' - containerregistrytype: Container Registry - dockerRegistryEndpoint: ${{ parameters.registryEndpoint }} - dockerComposeFile: src/docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=${{ variables['Build.SourceBranchName'] }} - PLATFORM=win - NODE_IMAGE=stefanscherer/node-windows:10 - - task: DockerCompose@0 - displayName: Compose push ${{ parameters.services }} - inputs: - dockerComposeCommand: 'push ${{ parameters.services }}' - containerregistrytype: Container Registry - dockerRegistryEndpoint: ${{ parameters.registryEndpoint }} - dockerComposeFile: src/docker-compose.yml - qualifyImageNames: true - projectName: "" - dockerComposeFileArgs: | - TAG=${{ variables['Build.SourceBranchName'] }} - PLATFORM=win diff --git a/build/azure-devops/catalog-api/azure-pipelines.yml b/build/azure-devops/catalog-api/azure-pipelines.yml deleted file mode 100644 index b22146ec82..0000000000 --- a/build/azure-devops/catalog-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Catalog/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/catalog-api/* - - deploy/k8s/helm/catalog-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: catalog-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: catalog.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/identity-api/azure-pipelines.yml b/build/azure-devops/identity-api/azure-pipelines.yml deleted file mode 100644 index e3dc070b83..0000000000 --- a/build/azure-devops/identity-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Identity/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/identity-api/* - - deploy/k8s/helm/identity-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: identity-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: identity.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/infrastructure/azure-pipelines.yml b/build/azure-devops/infrastructure/azure-pipelines.yml deleted file mode 100644 index 214e56d374..0000000000 --- a/build/azure-devops/infrastructure/azure-pipelines.yml +++ /dev/null @@ -1,28 +0,0 @@ -pool: - vmImage: 'ubuntu-16.04' -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/infrastructure/* - - deploy/k8s/helm/basket-data/* - - deploy/k8s/helm/keystore-data/* - - deploy/k8s/helm/nosql-data/* - - deploy/k8s/helm/rabbitmq/* - - deploy/k8s/helm/sql-data/* -steps: -- task: CopyFiles@2 - inputs: - sourceFolder: $(Build.SourcesDirectory)/deploy/k8s/helm - targetFolder: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm - artifactName: helm diff --git a/build/azure-devops/location-api/azure-pipelines.yml b/build/azure-devops/location-api/azure-pipelines.yml deleted file mode 100644 index d6b87e881a..0000000000 --- a/build/azure-devops/location-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Location/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/location-api/* - - deploy/k8s/helm/locations-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: locations-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: locations.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/marketing-api/azure-pipelines.yml b/build/azure-devops/marketing-api/azure-pipelines.yml deleted file mode 100644 index 5b253e1c11..0000000000 --- a/build/azure-devops/marketing-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Marketing/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/marketing-api/* - - deploy/k8s/helm/marketing-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: marketing-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: marketing.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/mobile-shopping-agg/azure-pipelines.yml b/build/azure-devops/mobile-shopping-agg/azure-pipelines.yml deleted file mode 100644 index 878f064b5b..0000000000 --- a/build/azure-devops/mobile-shopping-agg/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/ApiGateways/Mobile.Bff.Shopping/aggregator/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/mobile-shopping-agg/* - - deploy/k8s/helm/mobileshoppingagg/* -jobs: -- template: ../buildimages.yaml - parameters: - services: mobileshoppingagg - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: mobileshoppingagg - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) - diff --git a/build/azure-devops/multiarch.yaml b/build/azure-devops/multiarch.yaml deleted file mode 100644 index 1639fff879..0000000000 --- a/build/azure-devops/multiarch.yaml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - image: '' - branch: '' - registry: 'eshop' - registryEndpoint: '' - -jobs: -- job: manifest - condition: and(succeeded(),ne('${{ variables['Build.Reason'] }}', 'PullRequest')) - dependsOn: - # - BuildWindows - - BuildLinux - pool: - vmImage: 'Ubuntu 16.04' - steps: - - task: Docker@1 - displayName: Docker Login - inputs: - command: login - containerregistrytype: 'Container Registry' - dockerRegistryEndpoint: ${{ parameters.registryEndpoint }} - # Disabled windows deploy - # docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:${{ parameters.branch }} ${{ parameters.registry }}/${{ parameters.image }}:linux-${{ parameters.branch }} ${{ parameters.registry }}/${{ parameters.image }}:win-${{ parameters.branch }} - # docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:latest ${{ parameters.registry }}/${{ parameters.image }}:linux-latest ${{ parameters.registry }}/${{ parameters.image }}:win-latest - - bash: | - mkdir -p ~/.docker - sed '$ s/.$//' $DOCKER_CONFIG/config.json > ~/.docker/config.json - echo ',"experimental": "enabled" }' >> ~/.docker/config.json - docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:${{ parameters.branch }} ${{ parameters.registry }}/${{ parameters.image }}:linux-${{ parameters.branch }} - docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:latest ${{ parameters.registry }}/${{ parameters.image }}:linux-latest - docker --config ~/.docker manifest push ${{ parameters.registry }}/${{ parameters.image }}:${{ parameters.branch }} - docker --config ~/.docker manifest push ${{ parameters.registry }}/${{ parameters.image }}:latest - displayName: Create multiarch manifest diff --git a/build/azure-devops/ordering-api/azure-pipelines.yml b/build/azure-devops/ordering-api/azure-pipelines.yml deleted file mode 100644 index d11c4e2706..0000000000 --- a/build/azure-devops/ordering-api/azure-pipelines.yml +++ /dev/null @@ -1,29 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Ordering/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/ordering-api/* - - deploy/k8s/helm/ordering-api/* - - deploy/k8s/helm/ordering-backgroundtasks/* - - deploy/k8s/helm/ordering-signalrhub/* -jobs: -- template: ../buildimages.yaml - parameters: - services: ordering-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: ordering.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/payment-api/azure-pipelines.yml b/build/azure-devops/payment-api/azure-pipelines.yml deleted file mode 100644 index 6acdec6d31..0000000000 --- a/build/azure-devops/payment-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Payment/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/payment-api/* - - deploy/k8s/helm/payment-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: payment-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: payment.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/readme.md b/build/azure-devops/readme.md deleted file mode 100644 index 03680be34e..0000000000 --- a/build/azure-devops/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Azure DevOps build definitions - -This folder contains the Azure DevOps build definitions in YAML format. Each folder contains one `azure-pipelines.yml` that contains the build definition for one microservice (usually a Docker image, but some microservices generates more than one Docker image). - -For more information about YAML builds read the [Azure DevOps documentation](https://docs.microsoft.com/azure/devops/pipelines/get-started-yaml?view=azure-devops). \ No newline at end of file diff --git a/build/azure-devops/web-shopping-agg/azure-pipelines.yml b/build/azure-devops/web-shopping-agg/azure-pipelines.yml deleted file mode 100644 index 6537591cdb..0000000000 --- a/build/azure-devops/web-shopping-agg/azure-pipelines.yml +++ /dev/null @@ -1,26 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/ApiGateways/Web.Bff.Shopping/aggregator/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/web-shopping-agg/* - - deploy/k8s/helm/webshoppingagg/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webshoppingagg - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webshoppingagg - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/webhooks-api/azure-pipelines.yml b/build/azure-devops/webhooks-api/azure-pipelines.yml deleted file mode 100644 index d5e679c90a..0000000000 --- a/build/azure-devops/webhooks-api/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Services/Webhooks/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/webhooks-api/* - - deploy/k8s/helm/webhooks-api/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webhooks-api - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webhooks.api - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/webhooks-client/azure-pipelines.yml b/build/azure-devops/webhooks-client/azure-pipelines.yml deleted file mode 100644 index f12a384874..0000000000 --- a/build/azure-devops/webhooks-client/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Web/WebhookClient/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/webhooks-client/* - - deploy/k8s/helm/webhooks-web/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webhooks-client - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webhooks.client - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) diff --git a/build/azure-devops/webmvc/azure-pipelines.yml b/build/azure-devops/webmvc/azure-pipelines.yml deleted file mode 100644 index cd2fba59c2..0000000000 --- a/build/azure-devops/webmvc/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Web/WebMVC/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/webmvc/* - - deploy/k8s/helm/webmvc/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webmvc - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webmvc - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/webspa/azure-pipelines.yml b/build/azure-devops/webspa/azure-pipelines.yml deleted file mode 100644 index aefced84ad..0000000000 --- a/build/azure-devops/webspa/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Web/WebSPA/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/webspa/* - - deploy/k8s/helm/webspa/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webspa - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webspa - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/azure-devops/webstatus/azure-pipelines.yml b/build/azure-devops/webstatus/azure-pipelines.yml deleted file mode 100644 index eeb8c15a13..0000000000 --- a/build/azure-devops/webstatus/azure-pipelines.yml +++ /dev/null @@ -1,27 +0,0 @@ -variables: - registryEndpoint: eshop-registry -trigger: - branches: - include: - - master - - dev - paths: - include: - - src/BuildingBlocks/* - - src/Web/WebStatus/* - - build/azure-devops/buildimages.yml - - build/azure-devops/multiarch.yml - - build/azure-devops/webstatus/* - - deploy/k8s/helm/webstatus/* -jobs: -- template: ../buildimages.yaml - parameters: - services: webstatus - registryEndpoint: $(registryEndpoint) - helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm - helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm -- template: ../multiarch.yaml - parameters: - image: webstatus - branch: $(Build.SourceBranchName) - registryEndpoint: $(registryEndpoint) \ No newline at end of file diff --git a/build/multiarch-manifests/create-manifests.ps1 b/build/multiarch-manifests/create-manifests.ps1 index cc7f051942..6fc67b065c 100644 --- a/build/multiarch-manifests/create-manifests.ps1 +++ b/build/multiarch-manifests/create-manifests.ps1 @@ -12,7 +12,7 @@ Write-Host "Tags used are linux-master, win-master, linux-dev, win-dev, linux-la Write-Host "Multiarch images tags will be master, dev, latest" -ForegroundColor Yellow -$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "ordering.backgroundtasks", "marketing.api", "payment.api", "locations.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client" +$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "ordering.backgroundtasks", "payment.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client" foreach ($svc in $services) { Write-Host "Creating manifest for $svc and tags :latest, :master, and :dev" diff --git a/deploy/azure/az/servicebus/sbusdeploy.json b/deploy/azure/az/servicebus/sbusdeploy.json index 50c1c6c54c..46ac930aa9 100644 --- a/deploy/azure/az/servicebus/sbusdeploy.json +++ b/deploy/azure/az/servicebus/sbusdeploy.json @@ -14,8 +14,6 @@ "BasketSubscriptionName": "Basket", "CatalogSubscriptionName": "Catalog", "OrderingSubscriptionName": "Ordering", - "LocationsSubscriptionName": "Locations", - "MarketingSubscriptionName": "Marketing", "GracePeriodSubscriptionName": "GracePeriod", "PaymentSubscriptionName": "Payment", "location": "[resourceGroup().location]", @@ -135,46 +133,6 @@ "entityAvailabilityStatus": "Available" } }, - { - "apiVersion": "[variables('sbVersion')]", - "name": "[variables('LocationsSubscriptionName')]", - "type": "Subscriptions", - "dependsOn": [ - "[variables('serviceBusTopicName')]" - ], - "properties": { - "lockDuration": "00:00:30", - "requiresSession": false, - "defaultMessageTimeToLive": "14.00:00:00", - "deadLetteringOnMessageExpiration": true, - "deadLetteringOnFilterEvaluationExceptions": true, - "maxDeliveryCount": 10, - "enableBatchedOperations": false, - "status": "Active", - "autoDeleteOnIdle": "10675199.02:48:05.4775807", - "entityAvailabilityStatus": "Available" - } - }, - { - "apiVersion": "[variables('sbVersion')]", - "name": "[variables('MarketingSubscriptionName')]", - "type": "Subscriptions", - "dependsOn": [ - "[variables('serviceBusTopicName')]" - ], - "properties": { - "lockDuration": "00:00:30", - "requiresSession": false, - "defaultMessageTimeToLive": "14.00:00:00", - "deadLetteringOnMessageExpiration": true, - "deadLetteringOnFilterEvaluationExceptions": true, - "maxDeliveryCount": 10, - "enableBatchedOperations": false, - "status": "Active", - "autoDeleteOnIdle": "10675199.02:48:05.4775807", - "entityAvailabilityStatus": "Available" - } - }, { "apiVersion": "[variables('sbVersion')]", "name": "[variables('GracePeriodSubscriptionName')]", diff --git a/deploy/azure/az/sql/sqldeploy.json b/deploy/azure/az/sql/sqldeploy.json index 397c94ad64..2bc8eeac31 100644 --- a/deploy/azure/az/sql/sqldeploy.json +++ b/deploy/azure/az/sql/sqldeploy.json @@ -73,22 +73,7 @@ "dependsOn": [ "[concat('Microsoft.Sql/servers/', variables('sql_server_name'))]" ] - }, - { - "type": "databases", - "name": "[parameters('sql_server').dbs.marketing]", - "apiVersion": "2014-04-01-preview", - "location": "[resourceGroup().location]", - "properties": { - "edition": "Standard", - "collation": "SQL_Latin1_General_CP1_CI_AS", - "maxSizeBytes": "1073741824", - "requestedServiceObjectiveName": "S1" - }, - "dependsOn": [ - "[concat('Microsoft.Sql/servers/', variables('sql_server_name'))]" - ] - }, + }, { "type": "firewallrules", "name": "AllowAllWindowsAzureIps", diff --git a/deploy/azure/az/sql/sqldeploy.parameters.json b/deploy/azure/az/sql/sqldeploy.parameters.json index 982e78f4c0..473cf08cdb 100644 --- a/deploy/azure/az/sql/sqldeploy.parameters.json +++ b/deploy/azure/az/sql/sqldeploy.parameters.json @@ -8,8 +8,7 @@ "dbs": { "ordering": "orderingdb", "identity": "identitydb", - "catalog": "catalogdb", - "marketing": "marketingdb" + "catalog": "catalogdb" } } }, diff --git a/deploy/azure/az/storage/marketing/deploystorage.json b/deploy/azure/az/storage/marketing/deploystorage.json deleted file mode 100644 index 632e0d09ad..0000000000 --- a/deploy/azure/az/storage/marketing/deploystorage.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "marketingstorage": { - "type": "string" - }, - "profileName" : { - "type": "string" - }, - "endpointName" : { - "type": "string" - } - }, - "variables": { - "marketingstorage": "[concat(parameters('marketingstorage'), uniqueString(resourceGroup().id))]", - "endpointName": "[concat(parameters('endpointName'), uniqueString(resourceGroup().id))]", - "profileName": "[parameters('profileName')]" - }, - "resources": [ - { - "type": "Microsoft.Storage/storageAccounts", - "name": "[variables('marketingstorage')]", - "apiVersion": "2016-01-01", - "location": "[resourceGroup().location]", - "tags": { - "displayName": "[variables('marketingstorage')]" - }, - "sku": { - "name": "Standard_LRS" - }, - "kind": "Storage" - }, - { - "name": "[variables('profileName')]", - "type": "Microsoft.Cdn/profiles", - "location": "[resourceGroup().location]", - "apiVersion": "2016-04-02", - "tags": { - "displayName": "[variables('profileName')]" - }, - "sku": { - "name": "Standard_Verizon" - }, - "resources": [ - { - "apiVersion": "2016-04-02", - "name": "[variables('endpointName')]", - "type": "endpoints", - "dependsOn": [ - "[variables('profileName')]", - "[variables('marketingstorage')]" - ], - "location": "[resourceGroup().location]", - "tags": { - "displayName": "[variables('endpointName')]" - }, - "properties": { - "originHostHeader": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', variables('marketingstorage')),'2015-06-15' ).primaryEndpoints.blob,'https://',''),'/','')]", - "isHttpAllowed": true, - "isHttpsAllowed": true, - "queryStringCachingBehavior": "IgnoreQueryString", - "contentTypesToCompress": [ - "text/plain", - "text/html", - "text/css", - "application/x-javascript", - "text/javascript" - ], - "isCompressionEnabled": "True", - "origins": [ - { - "name": "origin1", - "properties": { - "hostName": "[replace(replace(reference(resourceId('Microsoft.Storage/storageAccounts', variables('marketingstorage')),'2015-06-15' ).primaryEndpoints.blob,'https://',''),'/','')]" - } - } - ] - } - } - ] - } - ], - "outputs": { - "hostName": { - "type": "string", - "value": "[reference(resourceId('Microsoft.cdn/profiles/endpoints', variables('profileName'), variables('endpointName'))).hostName]" - }, - "originHostHeader": { - "type": "string", - "value": "[reference(resourceId('Microsoft.cdn/profiles/endpoints', variables('profileName'), variables('endpointName'))).originHostHeader]" - } - } -} \ No newline at end of file diff --git a/deploy/azure/az/storage/marketing/deploystorage.parameters.json b/deploy/azure/az/storage/marketing/deploystorage.parameters.json deleted file mode 100644 index 40f7b3a1bb..0000000000 --- a/deploy/azure/az/storage/marketing/deploystorage.parameters.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "marketingstorage": { - "value": "marketing" - }, - "profileName":{ - "value": "eshopmarketing" - }, - "endpointName":{ - "value": "marketing-endpoint" - } - } -} \ No newline at end of file diff --git a/deploy/azure/az/storage/marketing/readme.md b/deploy/azure/az/storage/marketing/readme.md deleted file mode 100644 index c0ec2be7a6..0000000000 --- a/deploy/azure/az/storage/marketing/readme.md +++ /dev/null @@ -1,37 +0,0 @@ -# Deploying Marketing Storage - -The ARM template `deploystorage.json` and its parameter file (`deploystorage.parameters.json`) are used to deploy following resources: - -1. One Storage Account -2. One CDN profile -3. One Endpoint - -## Editing deploystorage.parameters.json file - -You can edit the `deploystorage.parameters.json` file to set your values, but is not needed. The only parameters that can -be set are: - -1. `marketingstorage` is a string that is used to create the storage account name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. - -2. `profileName` is a string that is used to create the CDN profile name. - -3. `endpointName` is a string that is used to create the storage endpoint name. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value. - -## Deploy the template - -Once parameter file is edited you can deploy it using [create-resources script](../../readme.md). - -i. e. if you are in windows, to deploy a Storage account in a new resourcegroup located in westus, go to `deploy\az` folder and type: - -``` -create-resources.cmd storage\marketing\deploystorage newResourceGroup -c westus -``` - - - - - - - - - diff --git a/deploy/azure/readme.md b/deploy/azure/readme.md index 27b168713b..cc35bb0010 100644 --- a/deploy/azure/readme.md +++ b/deploy/azure/readme.md @@ -22,8 +22,6 @@ Using `docker-machine` is the recommended way to create a VM with docker install 3. [Deploying Redis Cache](az/redis/readme.md) 4. [Deploying Cosmosdb](az/cosmos/readme.md) 5. [Deploying Catalog Storage](az/storage/catalog/readme.md) -6. [Deploying Marketing Storage](az/storage/marketing/readme.md) -7. [Deploying Marketing Azure functions](az/azurefunctions/readme.md) diff --git a/deploy/k8s/archived/helm/apigwmm/.helmignore b/deploy/k8s/archived/helm/apigwmm/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/archived/helm/apigwmm/Chart.yaml b/deploy/k8s/archived/helm/apigwmm/Chart.yaml deleted file mode 100644 index 50b3d07c6c..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: apigwmm -version: 0.1.0 diff --git a/deploy/k8s/archived/helm/apigwmm/envoy.yaml b/deploy/k8s/archived/helm/apigwmm/envoy.yaml deleted file mode 100644 index 54b1afa060..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/envoy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/deploy/k8s/archived/helm/apigwmm/templates/NOTES.txt b/deploy/k8s/archived/helm/apigwmm/templates/NOTES.txt deleted file mode 100644 index 30ef33447b..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -eShop API Gateway for Mobile Marketing services installed ----------------------------------------------------------- \ No newline at end of file diff --git a/deploy/k8s/archived/helm/apigwmm/templates/_helpers.tpl b/deploy/k8s/archived/helm/apigwmm/templates/_helpers.tpl deleted file mode 100644 index fd3d89212a..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "apigwmm.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "apigwmm.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "apigwmm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/archived/helm/apigwmm/templates/_names.tpl b/deploy/k8s/archived/helm/apigwmm/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/apigwmm/templates/deployment.yaml b/deploy/k8s/archived/helm/apigwmm/templates/deployment.yaml deleted file mode 100644 index f93706bb97..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/deployment.yaml +++ /dev/null @@ -1,110 +0,0 @@ -{{- $name := include "apigwmm.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "apigwmm.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ $envoycfgname }} - items: - - key: envoy.yaml - path: envoy.yaml - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: IfNotPresent - volumeMounts: - - name: config - mountPath: {{ .Values.envoy.configPath }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - - name: admin - containerPort: 8001 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/archived/helm/apigwmm/templates/envoy-cm.yaml b/deploy/k8s/archived/helm/apigwmm/templates/envoy-cm.yaml deleted file mode 100644 index 71728d084c..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/envoy-cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- $name := include "apigwmm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "envoy-{{ $name }}" - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} - diff --git a/deploy/k8s/archived/helm/apigwmm/templates/ingress.yaml b/deploy/k8s/archived/helm/apigwmm/templates/ingress.yaml deleted file mode 100644 index 44e9a90fcd..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/ingress.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" . -}} -{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ template "apigwmm.fullname" . }} - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} - cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} -{{- end }} -{{- if .Values.inf.mesh.enabled }} -{{- with .Values.ingress.mesh.annotations }} -{{ toYaml . | indent 4 }} -{{- end }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $serviceName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/deploy/k8s/archived/helm/apigwmm/templates/service.yaml b/deploy/k8s/archived/helm/apigwmm/templates/service.yaml deleted file mode 100644 index 286277c7d6..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.mobilemarketingapigw }} - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - - port: {{ .Values.service.adminPort }} - targetPort: admin - protocol: TCP - name: admin - selector: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/archived/helm/apigwmm/values.yaml b/deploy/k8s/archived/helm/apigwmm/values.yaml deleted file mode 100644 index 21f12f27ac..0000000000 --- a/deploy/k8s/archived/helm/apigwmm/values.yaml +++ /dev/null @@ -1,45 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /mobilemarketingapigw - -image: - repository: envoyproxy/envoy - tag: v1.11.1 - -service: - type: ClusterIP - port: 80 - adminPort: 8001 - -ingress: - enabled: true - annotations: - nginx.ingress.kubernetes.io/rewrite-target: "/" - ingress.kubernetes.io/rewrite-target: "/" - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -env: {} - -envoy: - configPath: /etc/envoy - -probes: - liveness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 15 - port: 8001 - readiness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 60 - port: 8001 \ No newline at end of file diff --git a/deploy/k8s/archived/helm/apigwwm/.helmignore b/deploy/k8s/archived/helm/apigwwm/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/archived/helm/apigwwm/Chart.yaml b/deploy/k8s/archived/helm/apigwwm/Chart.yaml deleted file mode 100644 index 4c20829694..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: apigwwm -version: 0.1.0 diff --git a/deploy/k8s/archived/helm/apigwwm/envoy.yaml b/deploy/k8s/archived/helm/apigwwm/envoy.yaml deleted file mode 100644 index c6f3421de4..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/envoy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/deploy/k8s/archived/helm/apigwwm/templates/NOTES.txt b/deploy/k8s/archived/helm/apigwwm/templates/NOTES.txt deleted file mode 100644 index 3420c97c83..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -eShop API Gateway for Web Marketing services installed ------------------------------------------------------- \ No newline at end of file diff --git a/deploy/k8s/archived/helm/apigwwm/templates/_helpers.tpl b/deploy/k8s/archived/helm/apigwwm/templates/_helpers.tpl deleted file mode 100644 index 194cf96ca8..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "apigwwm.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "apigwwm.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "apigwwm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/archived/helm/apigwwm/templates/_names.tpl b/deploy/k8s/archived/helm/apigwwm/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/apigwwm/templates/deployment.yaml b/deploy/k8s/archived/helm/apigwwm/templates/deployment.yaml deleted file mode 100644 index 6ceb1fa1bf..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/deployment.yaml +++ /dev/null @@ -1,110 +0,0 @@ -{{- $name := include "apigwwm.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "apigwwm.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ $envoycfgname }} - items: - - key: envoy.yaml - path: envoy.yaml - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: IfNotPresent - volumeMounts: - - name: config - mountPath: {{ .Values.envoy.configPath }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - - name: admin - containerPort: 8001 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/archived/helm/apigwwm/templates/envoy-cm.yaml b/deploy/k8s/archived/helm/apigwwm/templates/envoy-cm.yaml deleted file mode 100644 index 4d6307e36f..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/envoy-cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- $name := include "apigwwm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "envoy-{{ $name }}" - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - {{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 -}} - diff --git a/deploy/k8s/archived/helm/apigwwm/templates/ingress.yaml b/deploy/k8s/archived/helm/apigwwm/templates/ingress.yaml deleted file mode 100644 index 00d54c226d..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/ingress.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" . -}} -{{- $serviceName := .Values.app.svc.webmarketingapigw -}} - -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ template "apigwwm.fullname" . }} - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} - cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} -{{- end }} -{{- if .Values.inf.mesh.enabled }} -{{- with .Values.ingress.mesh.annotations }} -{{ toYaml . | indent 4 }} -{{- end }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $serviceName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/deploy/k8s/archived/helm/apigwwm/templates/service.yaml b/deploy/k8s/archived/helm/apigwwm/templates/service.yaml deleted file mode 100644 index cb11cc6653..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.webmarketingapigw }} - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - - port: {{ .Values.service.adminPort }} - targetPort: admin - protocol: TCP - name: admin - selector: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/archived/helm/apigwwm/values.yaml b/deploy/k8s/archived/helm/apigwwm/values.yaml deleted file mode 100644 index d866c2d3c7..0000000000 --- a/deploy/k8s/archived/helm/apigwwm/values.yaml +++ /dev/null @@ -1,46 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /webmarketingapigw - -image: - repository: envoyproxy/envoy - tag: v1.11.1 - -service: - type: ClusterIP - port: 80 - adminPort: 8001 - -ingress: - enabled: true - annotations: - nginx.ingress.kubernetes.io/rewrite-target: "/" - ingress.kubernetes.io/rewrite-target: "/" - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: {} - -envoy: - configPath: /etc/envoy - -probes: - liveness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 15 - port: 8001 - readiness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 60 - port: 8001 \ No newline at end of file diff --git a/deploy/k8s/archived/helm/app.yaml b/deploy/k8s/archived/helm/app.yaml index e83ea28232..acea31ef1c 100644 --- a/deploy/k8s/archived/helm/app.yaml +++ b/deploy/k8s/archived/helm/app.yaml @@ -13,14 +13,10 @@ app: # app global settings spa: "" # ingress entry for web spa status: webstatus # ingress entry for web status webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api webhooks: webhooks-api # ingress entry for webhooks api webhooksweb: webhooks-web # ingress entry for webhooks web demo client svc: @@ -34,13 +30,9 @@ app: # app global settings spa: webspa # service name for web spa status: webstatus # service name for web status webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw webshoppingagg: webshoppingagg # service name for web shopping aggregator mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator payment: payment-api # service name for payment api - locations: locations-api # service name for locations api - marketing: marketing-api # service name for marketing ap webhooks: webhooks-api # service name for webhooks api webhooksweb: webhooks-client # service name for webhooks web diff --git a/deploy/k8s/archived/helm/basket-api/templates/configmap.yaml b/deploy/k8s/archived/helm/basket-api/templates/configmap.yaml index 2de0e28c79..8a36f74ace 100644 --- a/deploy/k8s/archived/helm/basket-api/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/basket-api/templates/configmap.yaml @@ -12,7 +12,6 @@ metadata: data: basket__ConnectionString: {{ .Values.inf.redis.basket.constr }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }} - basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" \ No newline at end of file diff --git a/deploy/k8s/archived/helm/basket-api/values.yaml b/deploy/k8s/archived/helm/basket-api/values.yaml index 121de02def..dcd6aa763b 100644 --- a/deploy/k8s/archived/helm/basket-api/values.yaml +++ b/deploy/k8s/archived/helm/basket-api/values.yaml @@ -36,8 +36,6 @@ env: key: all__UseAzureServiceBus - name: IdentityUrl key: urls__IdentityUrl - - name: UseLoadTest - key: basket__EnableLoadTest # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) values: - name: OrchestratorType diff --git a/deploy/k8s/archived/helm/deploy-all.ps1 b/deploy/k8s/archived/helm/deploy-all.ps1 index 1711c0c2c0..51d87e7205 100644 --- a/deploy/k8s/archived/helm/deploy-all.ps1 +++ b/deploy/k8s/archived/helm/deploy-all.ps1 @@ -113,7 +113,7 @@ if (-not [string]::IsNullOrEmpty($registry)) { Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green $infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data") -$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") +$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") $gateways = ("apigwmm", "apigwms", "apigwwm", "apigwws") if ($deployInfrastructure) { diff --git a/deploy/k8s/archived/helm/deploy-all.sh b/deploy/k8s/archived/helm/deploy-all.sh index 6f6d868aaa..ad76bd54c1 100644 --- a/deploy/k8s/archived/helm/deploy-all.sh +++ b/deploy/k8s/archived/helm/deploy-all.sh @@ -142,7 +142,7 @@ fi if [[ $push_images ]]; then echo "#################### Pushing images to the container registry ####################" - services=(basket.api catalog.api identity.api ordering.api marketing.api payment.api locations.api webmvc webspa webstatus) + services=(basket.api catalog.api identity.api ordering.api payment.api webmvc webspa webstatus) if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then image_tag=linux-$image_tag @@ -209,7 +209,7 @@ fi echo "#################### Begin $app_name installation using Helm ####################" infras=(sql-data nosql-data rabbitmq keystore-data basket-data) -charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web) +charts=(eshop-common apigwms apigwws basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web) if [[ !$skip_infrastructure ]]; then for infra in "${infras[@]}" diff --git a/deploy/k8s/archived/helm/identity-api/templates/configmap.yaml b/deploy/k8s/archived/helm/identity-api/templates/configmap.yaml index 264ceb7457..7c670f6469 100644 --- a/deploy/k8s/archived/helm/identity-api/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/identity-api/templates/configmap.yaml @@ -2,8 +2,6 @@ {{- $sqlsrv := include "sql-name" . -}} {{- $mvc_url := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} {{- $spa_url := include "url-of" (list .Values.app.ingress.entries.spa .) -}} -{{- $locations_url := include "url-of" (list .Values.app.ingress.entries.locations .) -}} -{{- $marketing_url := include "url-of" (list .Values.app.ingress.entries.marketing .) -}} {{- $basket_url := include "url-of" (list .Values.app.ingress.entries.basket .) -}} {{- $ordering_url := include "url-of" (list .Values.app.ingress.entries.ordering .) -}} {{- $mobileshoppingagg := include "url-of" (list .Values.app.ingress.entries.mobileshoppingagg .) -}} @@ -27,8 +25,6 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" mvc_e: http://{{ $mvc_url }} spa_e: http://{{ $spa_url }} - locations_e: http://{{ $locations_url }} - marketing_e: http://{{ $marketing_url }} basket_e: http://{{ $basket_url }} ordering_e: http://{{ $ordering_url }} mobileshoppingagg_e: http://{{ $mobileshoppingagg }} diff --git a/deploy/k8s/archived/helm/identity-api/values.yaml b/deploy/k8s/archived/helm/identity-api/values.yaml index 7b57dfde11..92fd57283b 100644 --- a/deploy/k8s/archived/helm/identity-api/values.yaml +++ b/deploy/k8s/archived/helm/identity-api/values.yaml @@ -40,10 +40,6 @@ env: key: mvc_e - name: SpaClient key: spa_e - - name: LocationApiClient - key: locations_e - - name: MarketingApiClient - key: marketing_e - name: BasketApiClient key: basket_e - name: OrderingApiClient diff --git a/deploy/k8s/archived/helm/inf.yaml b/deploy/k8s/archived/helm/inf.yaml index 938be3d45e..1ce48d67e1 100644 --- a/deploy/k8s/archived/helm/inf.yaml +++ b/deploy/k8s/archived/helm/inf.yaml @@ -19,16 +19,8 @@ inf: db: OrderingDb # Ordering API SQL db name identity: db: IdentityDb # Ordering API SQL db name - marketing: - db: MarketingDb # Marketing API SQL db name webhooks: db: WebhooksDb # Webhooks DB - mongo: -# host: my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used - locations: - database: LocationsDb - marketing: - database: MarketingDb redis: # inf.redis defines the redis' connection strings basket: svc: basket-data # Name of k8s svc for basket redis @@ -46,7 +38,6 @@ inf: dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED local: false # True when deploying on "local K8s" provided by Docker Desktop. misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not useAzureStorage: false # If catalog api uses azure storage or not # registry: # Uncomment "registry" to specify registry secret # secretName: # secretName is the name of the secret inside k8s diff --git a/deploy/k8s/archived/helm/locations-api/.helmignore b/deploy/k8s/archived/helm/locations-api/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/archived/helm/locations-api/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/archived/helm/locations-api/Chart.yaml b/deploy/k8s/archived/helm/locations-api/Chart.yaml deleted file mode 100644 index 5126fe847c..0000000000 --- a/deploy/k8s/archived/helm/locations-api/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: locations-api -version: 0.1.0 diff --git a/deploy/k8s/archived/helm/locations-api/templates/NOTES.txt b/deploy/k8s/archived/helm/locations-api/templates/NOTES.txt deleted file mode 100644 index 3b48889bf7..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/NOTES.txt +++ /dev/null @@ -1,9 +0,0 @@ -eShop Locations API installed. ------------------------------- - -This API is not directly exposed outside cluster. If need to access it use: - -export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "locations-api.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -echo "Visit http://127.0.0.1:8080 to use your application" -kubectl port-forward $POD_NAME 8080:80 - diff --git a/deploy/k8s/archived/helm/locations-api/templates/_helpers.tpl b/deploy/k8s/archived/helm/locations-api/templates/_helpers.tpl deleted file mode 100644 index 086a461baf..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "locations-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "locations-api.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "locations-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/archived/helm/locations-api/templates/_names.tpl b/deploy/k8s/archived/helm/locations-api/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/locations-api/templates/configmap.yaml b/deploy/k8s/archived/helm/locations-api/templates/configmap.yaml deleted file mode 100644 index c5d7525090..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/configmap.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- $name := include "locations-api.fullname" . -}} -{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} -{{- $mongo := include "mongo-name" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - all__EventBusConnection: {{ .Values.inf.eventbus.constr }} - all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" - internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }} - urls__IdentityUrl: {{ $identity }} - locations__ConnectionString: mongodb://{{ $mongo }} - locations__Database: {{ .Values.inf.mongo.locations.database }} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/locations-api/templates/deployment.yaml b/deploy/k8s/archived/helm/locations-api/templates/deployment.yaml deleted file mode 100644 index 9a5bb608c5..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/deployment.yaml +++ /dev/null @@ -1,96 +0,0 @@ -{{- $name := include "locations-api.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "locations-api.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/archived/helm/locations-api/templates/service.yaml b/deploy/k8s/archived/helm/locations-api/templates/service.yaml deleted file mode 100644 index abd628beb5..0000000000 --- a/deploy/k8s/archived/helm/locations-api/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.locations }} - labels: - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/archived/helm/locations-api/values.yaml b/deploy/k8s/archived/helm/locations-api/values.yaml deleted file mode 100644 index 4718f2a0bb..0000000000 --- a/deploy/k8s/archived/helm/locations-api/values.yaml +++ /dev/null @@ -1,66 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /locations-api - -image: - repository: eshop/locations.api - tag: latest - pullPolicy: IfNotPresent - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: {} - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: ApplicationInsights__InstrumentationKey - key: all__InstrumentationKey - - name: EventBusConnection - key: all__EventBusConnection - - name: AzureServiceBusEnabled - key: all__UseAzureServiceBus - - name: UseLoadTest - key: all_EnableLoadTest - - name: IdentityUrl - key: internalurls__IdentityUrl - - name: IdentityUrlExternal - key: urls__IdentityUrl - - name: ConnectionString - key: locations__ConnectionString - - name: Database - key: locations__Database - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development - - name: OrchestratorType - value: 'K8S' -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 diff --git a/deploy/k8s/archived/helm/marketing-api/.helmignore b/deploy/k8s/archived/helm/marketing-api/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/archived/helm/marketing-api/Chart.yaml b/deploy/k8s/archived/helm/marketing-api/Chart.yaml deleted file mode 100644 index 173f94fd64..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: marketing-api -version: 0.1.0 diff --git a/deploy/k8s/archived/helm/marketing-api/templates/NOTES.txt b/deploy/k8s/archived/helm/marketing-api/templates/NOTES.txt deleted file mode 100644 index 7fa66ed472..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/NOTES.txt +++ /dev/null @@ -1,9 +0,0 @@ -eShop Marketing API installed. ------------------------------- - -This API is not directly exposed outside cluster. If need to access it use: - -export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "marketing-api.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -echo "Visit http://127.0.0.1:8080 to use your application" -kubectl port-forward $POD_NAME 8080:80 - diff --git a/deploy/k8s/archived/helm/marketing-api/templates/_helpers.tpl b/deploy/k8s/archived/helm/marketing-api/templates/_helpers.tpl deleted file mode 100644 index c252aeeacf..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "marketing-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "marketing-api.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "marketing-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/archived/helm/marketing-api/templates/_names.tpl b/deploy/k8s/archived/helm/marketing-api/templates/_names.tpl deleted file mode 100644 index 605e92e7ee..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/_names.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} - -{{- define "protocol" -}} -{{- if .Values.inf.tls.enabled -}} -{{- printf "%s" "https" -}} -{{- else -}} -{{- printf "%s" "http" -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/marketing-api/templates/configmap.yaml b/deploy/k8s/archived/helm/marketing-api/templates/configmap.yaml deleted file mode 100644 index e6b495a7a0..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/configmap.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- $name := include "marketing-api.fullname" . -}} -{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} -{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} -{{- $mongo := include "mongo-name" . -}} -{{- $sqlsrv := include "sql-name" . -}} -{{- $protocol := include "protocol" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - all__EventBusConnection: {{ .Values.inf.eventbus.constr }} - all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" - internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }} - urls__IdentityUrl: {{ $protocol }}://{{ $identity }} - marketing__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.marketing.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; - marketing__MongoConnectionString: mongodb://{{ $mongo }} - marketing__MongoDatabase: {{ .Values.inf.mongo.marketing.database }} - marketing__PicBaseUrl: {{ $protocol }}://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/ \ No newline at end of file diff --git a/deploy/k8s/archived/helm/marketing-api/templates/deployment.yaml b/deploy/k8s/archived/helm/marketing-api/templates/deployment.yaml deleted file mode 100644 index 60d4cd1a30..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/deployment.yaml +++ /dev/null @@ -1,96 +0,0 @@ -{{- $name := include "marketing-api.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "marketing-api.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/archived/helm/marketing-api/templates/service.yaml b/deploy/k8s/archived/helm/marketing-api/templates/service.yaml deleted file mode 100644 index 0e9bfbea27..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.marketing }} - labels: - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/archived/helm/marketing-api/values.yaml b/deploy/k8s/archived/helm/marketing-api/values.yaml deleted file mode 100644 index 00bebf27fe..0000000000 --- a/deploy/k8s/archived/helm/marketing-api/values.yaml +++ /dev/null @@ -1,70 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /marketing-api - -image: - repository: eshop/marketing.api - tag: latest - pullPolicy: IfNotPresent - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: {} - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: ApplicationInsights__InstrumentationKey - key: all__InstrumentationKey - - name: EventBusConnection - key: all__EventBusConnection - - name: AzureServiceBusEnabled - key: all__UseAzureServiceBus - - name: UseLoadTest - key: all_EnableLoadTest - - name: IdentityUrl - key: internalurls__IdentityUrl - - name: IdentityUrlExternal - key: urls__IdentityUrl - - name: ConnectionString - key: marketing__ConnectionString - - name: MongoConnectionString - key: marketing__MongoConnectionString - - name: MongoDatabase - key: marketing__MongoDatabase - - name: PicBaseUrl - key: marketing__PicBaseUrl - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development - - name: OrchestratorType - value: 'K8S' -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 diff --git a/deploy/k8s/archived/helm/mobileshoppingagg/templates/NOTES.txt b/deploy/k8s/archived/helm/mobileshoppingagg/templates/NOTES.txt index 61971f717f..e7e5081ea3 100644 --- a/deploy/k8s/archived/helm/mobileshoppingagg/templates/NOTES.txt +++ b/deploy/k8s/archived/helm/mobileshoppingagg/templates/NOTES.txt @@ -1,4 +1,4 @@ -eShop Mobile Marketing Aggregator is installed +eShop Mobile Shopping Aggregator is installed ---------------------------------------------- This API is not directly exposed outside cluster. If need to access it use: diff --git a/deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml b/deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml index 1ca69509ff..b55afbdb2b 100644 --- a/deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/mobileshoppingagg/templates/configmap.yaml @@ -11,7 +11,6 @@ metadata: heritage: {{ .Release.Service }} data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__catalog: http://{{ .Values.app.svc.catalog }} @@ -21,9 +20,7 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}" internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}" internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}" diff --git a/deploy/k8s/archived/helm/mobileshoppingagg/values.yaml b/deploy/k8s/archived/helm/mobileshoppingagg/values.yaml index 844a59441f..fc7ce7a38c 100644 --- a/deploy/k8s/archived/helm/mobileshoppingagg/values.yaml +++ b/deploy/k8s/archived/helm/mobileshoppingagg/values.yaml @@ -49,12 +49,8 @@ env: key: internalurls__identity__hc - name: OrderingUrlHC key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - name: PaymentUrlHC key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - name: urls__grpcBasket key: internalurls__grpcBasket - name: urls__grpcCatalog diff --git a/deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml b/deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml index e64a6c8413..e93dddd5cb 100644 --- a/deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/ordering-api/templates/configmap.yaml @@ -12,7 +12,6 @@ metadata: heritage: {{ .Release.Service }} data: ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; - ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" urls__IdentityUrl: http://{{ .Values.app.svc.identity }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" diff --git a/deploy/k8s/archived/helm/ordering-api/values.yaml b/deploy/k8s/archived/helm/ordering-api/values.yaml index 7eff1a48b1..505ccc3793 100644 --- a/deploy/k8s/archived/helm/ordering-api/values.yaml +++ b/deploy/k8s/archived/helm/ordering-api/values.yaml @@ -41,8 +41,6 @@ env: key: all__EventBusConnection - name: AzureServiceBusEnabled key: all__UseAzureServiceBus - - name: UseLoadTest - key: ordering__EnableLoadTest - name: IdentityUrl key: urls__IdentityUrl # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) diff --git a/deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml b/deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml index 7ed4a0e8e2..928692c570 100644 --- a/deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/ordering-backgroundtasks/templates/configmap.yaml @@ -13,7 +13,6 @@ metadata: heritage: {{ .Release.Service }} data: ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; - ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" diff --git a/deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml b/deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml index d065f03451..18abe99a53 100644 --- a/deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml +++ b/deploy/k8s/archived/helm/ordering-backgroundtasks/values.yaml @@ -44,8 +44,6 @@ env: key: all__EventBusConnection - name: AzureServiceBusEnabled key: all__UseAzureServiceBus - - name: UseLoadTest - key: ordering__EnableLoadTest - name: CheckUpdateTime key: graceperiodmanager__CheckUpdateTime - name: GracePeriodTime diff --git a/deploy/k8s/archived/helm/webmvc/templates/configmap.yaml b/deploy/k8s/archived/helm/webmvc/templates/configmap.yaml index 2aa06fc7f1..2062bdabc2 100644 --- a/deploy/k8s/archived/helm/webmvc/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/webmvc/templates/configmap.yaml @@ -16,10 +16,8 @@ metadata: data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webmvc__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} - internalurls__apigwwm: http://{{ .Values.app.svc.webmarketingapigw }} internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc urls__apigwws: {{ $protocol }}://{{ $webshoppingapigw }} urls__mvc: {{ $protocol }}://{{ $mvc }} diff --git a/deploy/k8s/archived/helm/webmvc/values.yaml b/deploy/k8s/archived/helm/webmvc/values.yaml index 973f187f5b..1f40dbb039 100644 --- a/deploy/k8s/archived/helm/webmvc/values.yaml +++ b/deploy/k8s/archived/helm/webmvc/values.yaml @@ -32,8 +32,6 @@ env: configmap: - name: ApplicationInsights__InstrumentationKey key: all__InstrumentationKey - - name: UseLoadTest - key: all_EnableLoadTest - name: DPConnectionString key: webmvc__keystore - name: PurchaseUrl @@ -44,8 +42,6 @@ env: key: urls__mvc - name: IdentityUrl key: urls__IdentityUrl - - name: MarketingUrl - key: internalurls__apigwwm - name: IdentityUrlHC key: internalurls__identity__hc - name: SignalrHubUrl diff --git a/deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml b/deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml index d01de8dcdd..b21de5a38b 100644 --- a/deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/webshoppingagg/templates/configmap.yaml @@ -11,7 +11,6 @@ metadata: heritage: {{ .Release.Service }} data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__catalog: http://{{ .Values.app.svc.catalog }} @@ -21,9 +20,7 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}" internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}" internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}" diff --git a/deploy/k8s/archived/helm/webshoppingagg/values.yaml b/deploy/k8s/archived/helm/webshoppingagg/values.yaml index 15501c727b..602dcf93ad 100644 --- a/deploy/k8s/archived/helm/webshoppingagg/values.yaml +++ b/deploy/k8s/archived/helm/webshoppingagg/values.yaml @@ -49,12 +49,8 @@ env: key: internalurls__identity__hc - name: OrderingUrlHC key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - name: PaymentUrlHC key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - name: urls__grpcBasket key: internalurls__grpcBasket - name: urls__grpcCatalog diff --git a/deploy/k8s/archived/helm/webspa/templates/configmap.yaml b/deploy/k8s/archived/helm/webspa/templates/configmap.yaml index ecdbf8b633..353ff638f8 100644 --- a/deploy/k8s/archived/helm/webspa/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/webspa/templates/configmap.yaml @@ -1,7 +1,6 @@ {{- $name := include "webspa.fullname" . -}} {{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} -{{- $webmarketingapigw := include "url-of" (list .Values.app.ingress.entries.webmarketingapigw .) -}} {{- $spa := include "url-of" (list .Values.app.ingress.entries.spa .) -}} {{- $mongo := include "mongo-name" . -}} {{- $protocol := include "protocol" . -}} @@ -23,5 +22,4 @@ data: internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc urls__apigwws: {{ $protocol }}://{{ $webshoppingapigw }} urls__spa: {{ $protocol }}://{{ $spa }} - urls__IdentityUrl: {{ $protocol }}://{{ $identity }} - urls__apigwwm: {{ $protocol }}://{{ $webmarketingapigw }} \ No newline at end of file + urls__IdentityUrl: {{ $protocol }}://{{ $identity }} \ No newline at end of file diff --git a/deploy/k8s/archived/helm/webspa/values.yaml b/deploy/k8s/archived/helm/webspa/values.yaml index e1547ed394..08e1481111 100644 --- a/deploy/k8s/archived/helm/webspa/values.yaml +++ b/deploy/k8s/archived/helm/webspa/values.yaml @@ -32,8 +32,6 @@ env: configmap: - name: ApplicationInsights__InstrumentationKey key: all__InstrumentationKey - - name: UseLoadTest - key: all_EnableLoadTest - name: DPConnectionString key: webspa__keystore - name: PurchaseUrl @@ -42,8 +40,6 @@ env: key: urls__spa - name: IdentityUrl key: urls__IdentityUrl - - name: MarketingUrl - key: urls__apigwwm - name: IdentityUrlHC key: internalurls__identity__hc - name: SignalrHubUrl diff --git a/deploy/k8s/archived/helm/webstatus/templates/configmap.yaml b/deploy/k8s/archived/helm/webstatus/templates/configmap.yaml index bf40d2a7d1..b538646022 100644 --- a/deploy/k8s/archived/helm/webstatus/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/webstatus/templates/configmap.yaml @@ -24,12 +24,8 @@ data: internalurls__spa__hc: http://{{ .Values.app.svc.spa }}/hc name__apigwws__hc: Web Shopping API GW HTTP Check internalurls__apigwws__hc: http://{{ .Values.app.svc.webshoppingapigw }}:8001/ready - name__apigwwm__hc: Web Marketing API GW HTTP Check - internalurls__apigwwm__hc: http://{{ .Values.app.svc.webmarketingapigw }}:8001/ready name__apigwms__hc: Mobile Shopping API GW HTTP Check internalurls__apigwms__hc: http://{{ .Values.app.svc.mobileshoppingapigw }}:8001/ready - name__apigwmm__hc: Mobile Marketing API GW HTTP Check - internalurls__apigwmm__hc: http://{{ .Values.app.svc.mobilemarketingapigw }}:8001/ready name__apigwwsagg__hc: Web Shopping Aggregator GW HTTP Check internalurls__apigwwsagg__hc: http://{{ .Values.app.svc.webshoppingagg }}/hc name__apigwmsagg__hc: Mobile Shopping Aggregator HTTP Check @@ -44,10 +40,6 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc name__identity__hc: Identity HTTP Check internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - name__marketing__hc: Marketing HTTP Check - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - name__locations__hc: Locations HTTP Check - internalurls__locations__hc: http://{{ .Values.app.svc.locations }}/hc name__payment__hc: Payment HTTP Check internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc name__signalrhub__hc: Ordering SignalR Hub HTTP Check diff --git a/deploy/k8s/archived/helm/webstatus/values.yaml b/deploy/k8s/archived/helm/webstatus/values.yaml index e5a23ec857..1ce23fec36 100644 --- a/deploy/k8s/archived/helm/webstatus/values.yaml +++ b/deploy/k8s/archived/helm/webstatus/values.yaml @@ -67,24 +67,16 @@ env: - name: HealthChecks-UI__HealthChecks__7__Uri key: internalurls__identity__hc - name: HealthChecks-UI__HealthChecks__8__Name - key: name__marketing__hc - - name: HealthChecks-UI__HealthChecks__8__Uri - key: internalurls__marketing__hc - - name: HealthChecks-UI__HealthChecks__9__Name - key: name__locations__hc - - name: HealthChecks-UI__HealthChecks__9__Uri - key: internalurls__locations__hc - - name: HealthChecks-UI__HealthChecks__10__Name key: name__payment__hc - - name: HealthChecks-UI__HealthChecks__10__Uri + - name: HealthChecks-UI__HealthChecks__8__Uri key: internalurls__payment__hc - - name: HealthChecks-UI__HealthChecks__11__Name + - name: HealthChecks-UI__HealthChecks__9__Name key: name__signalrhub__hc - - name: HealthChecks-UI__HealthChecks__11__Uri + - name: HealthChecks-UI__HealthChecks__9__Uri key: internalurls__signalrhub__hc - - name: HealthChecks-UI__HealthChecks__12__Name + - name: HealthChecks-UI__HealthChecks__10__Name key: name__orderingbackground__hc - - name: HealthChecks-UI__HealthChecks__12__Uri + - name: HealthChecks-UI__HealthChecks__10__Uri key: internalurls__orderingbackground__hc # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) diff --git a/deploy/k8s/helm/apigwmm/.helmignore b/deploy/k8s/helm/apigwmm/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/helm/apigwmm/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/helm/apigwmm/Chart.yaml b/deploy/k8s/helm/apigwmm/Chart.yaml deleted file mode 100644 index 50b3d07c6c..0000000000 --- a/deploy/k8s/helm/apigwmm/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: apigwmm -version: 0.1.0 diff --git a/deploy/k8s/helm/apigwmm/envoy.yaml b/deploy/k8s/helm/apigwmm/envoy.yaml deleted file mode 100644 index 54b1afa060..0000000000 --- a/deploy/k8s/helm/apigwmm/envoy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/deploy/k8s/helm/apigwmm/templates/NOTES.txt b/deploy/k8s/helm/apigwmm/templates/NOTES.txt deleted file mode 100644 index 30ef33447b..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -eShop API Gateway for Mobile Marketing services installed ----------------------------------------------------------- \ No newline at end of file diff --git a/deploy/k8s/helm/apigwmm/templates/_helpers.tpl b/deploy/k8s/helm/apigwmm/templates/_helpers.tpl deleted file mode 100644 index fd3d89212a..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "apigwmm.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "apigwmm.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "apigwmm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/helm/apigwmm/templates/_names.tpl b/deploy/k8s/helm/apigwmm/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/apigwmm/templates/deployment.yaml b/deploy/k8s/helm/apigwmm/templates/deployment.yaml deleted file mode 100644 index 70b4ffa8f3..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/deployment.yaml +++ /dev/null @@ -1,110 +0,0 @@ -{{- $name := include "apigwmm.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "apigwmm.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ $envoycfgname }} - items: - - key: envoy.yaml - path: envoy.yaml - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: IfNotPresent - volumeMounts: - - name: config - mountPath: {{ .Values.envoy.configPath }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - - name: admin - containerPort: 8001 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/helm/apigwmm/templates/envoy-cm.yaml b/deploy/k8s/helm/apigwmm/templates/envoy-cm.yaml deleted file mode 100644 index 66de90f5c8..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/envoy-cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- $name := include "apigwmm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "envoy-{{ $name }}" - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} - diff --git a/deploy/k8s/helm/apigwmm/templates/ingress.yaml b/deploy/k8s/helm/apigwmm/templates/ingress.yaml deleted file mode 100644 index 44e9a90fcd..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/ingress.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" . -}} -{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ template "apigwmm.fullname" . }} - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} - cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} -{{- end }} -{{- if .Values.inf.mesh.enabled }} -{{- with .Values.ingress.mesh.annotations }} -{{ toYaml . | indent 4 }} -{{- end }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $serviceName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/deploy/k8s/helm/apigwmm/templates/service.yaml b/deploy/k8s/helm/apigwmm/templates/service.yaml deleted file mode 100644 index 286277c7d6..0000000000 --- a/deploy/k8s/helm/apigwmm/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.mobilemarketingapigw }} - labels: - app: {{ template "apigwmm.name" . }} - chart: {{ template "apigwmm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - - port: {{ .Values.service.adminPort }} - targetPort: admin - protocol: TCP - name: admin - selector: - app: {{ template "apigwmm.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/helm/apigwmm/values.yaml b/deploy/k8s/helm/apigwmm/values.yaml deleted file mode 100644 index 21f12f27ac..0000000000 --- a/deploy/k8s/helm/apigwmm/values.yaml +++ /dev/null @@ -1,45 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /mobilemarketingapigw - -image: - repository: envoyproxy/envoy - tag: v1.11.1 - -service: - type: ClusterIP - port: 80 - adminPort: 8001 - -ingress: - enabled: true - annotations: - nginx.ingress.kubernetes.io/rewrite-target: "/" - ingress.kubernetes.io/rewrite-target: "/" - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -env: {} - -envoy: - configPath: /etc/envoy - -probes: - liveness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 15 - port: 8001 - readiness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 60 - port: 8001 \ No newline at end of file diff --git a/deploy/k8s/helm/apigwwm/.helmignore b/deploy/k8s/helm/apigwwm/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/helm/apigwwm/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/helm/apigwwm/Chart.yaml b/deploy/k8s/helm/apigwwm/Chart.yaml deleted file mode 100644 index 4c20829694..0000000000 --- a/deploy/k8s/helm/apigwwm/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: apigwwm -version: 0.1.0 diff --git a/deploy/k8s/helm/apigwwm/envoy.yaml b/deploy/k8s/helm/apigwwm/envoy.yaml deleted file mode 100644 index c6f3421de4..0000000000 --- a/deploy/k8s/helm/apigwwm/envoy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/deploy/k8s/helm/apigwwm/templates/NOTES.txt b/deploy/k8s/helm/apigwwm/templates/NOTES.txt deleted file mode 100644 index 3420c97c83..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -eShop API Gateway for Web Marketing services installed ------------------------------------------------------- \ No newline at end of file diff --git a/deploy/k8s/helm/apigwwm/templates/_helpers.tpl b/deploy/k8s/helm/apigwwm/templates/_helpers.tpl deleted file mode 100644 index 194cf96ca8..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "apigwwm.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "apigwwm.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "apigwwm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/helm/apigwwm/templates/_names.tpl b/deploy/k8s/helm/apigwwm/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/apigwwm/templates/deployment.yaml b/deploy/k8s/helm/apigwwm/templates/deployment.yaml deleted file mode 100644 index 8c8619f8af..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/deployment.yaml +++ /dev/null @@ -1,110 +0,0 @@ -{{- $name := include "apigwwm.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "apigwwm.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ $envoycfgname }} - items: - - key: envoy.yaml - path: envoy.yaml - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: IfNotPresent - volumeMounts: - - name: config - mountPath: {{ .Values.envoy.configPath }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - - name: admin - containerPort: 8001 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/helm/apigwwm/templates/envoy-cm.yaml b/deploy/k8s/helm/apigwwm/templates/envoy-cm.yaml deleted file mode 100644 index e197812c87..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/envoy-cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- $name := include "apigwwm.fullname" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "envoy-{{ $name }}" - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 -}} - diff --git a/deploy/k8s/helm/apigwwm/templates/ingress.yaml b/deploy/k8s/helm/apigwwm/templates/ingress.yaml deleted file mode 100644 index 00d54c226d..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/ingress.yaml +++ /dev/null @@ -1,47 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" . -}} -{{- $serviceName := .Values.app.svc.webmarketingapigw -}} - -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ template "apigwwm.fullname" . }} - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -{{- with .Values.ingress.annotations }} - annotations: -{{ toYaml . | indent 4 }} -{{- end }} -{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} - cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} -{{- end }} -{{- if .Values.inf.mesh.enabled }} -{{- with .Values.ingress.mesh.annotations }} -{{ toYaml . | indent 4 }} -{{- end }} -{{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $serviceName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/deploy/k8s/helm/apigwwm/templates/service.yaml b/deploy/k8s/helm/apigwwm/templates/service.yaml deleted file mode 100644 index cb11cc6653..0000000000 --- a/deploy/k8s/helm/apigwwm/templates/service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.webmarketingapigw }} - labels: - app: {{ template "apigwwm.name" . }} - chart: {{ template "apigwwm.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - - port: {{ .Values.service.adminPort }} - targetPort: admin - protocol: TCP - name: admin - selector: - app: {{ template "apigwwm.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/helm/apigwwm/values.yaml b/deploy/k8s/helm/apigwwm/values.yaml deleted file mode 100644 index d866c2d3c7..0000000000 --- a/deploy/k8s/helm/apigwwm/values.yaml +++ /dev/null @@ -1,46 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /webmarketingapigw - -image: - repository: envoyproxy/envoy - tag: v1.11.1 - -service: - type: ClusterIP - port: 80 - adminPort: 8001 - -ingress: - enabled: true - annotations: - nginx.ingress.kubernetes.io/rewrite-target: "/" - ingress.kubernetes.io/rewrite-target: "/" - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: {} - -envoy: - configPath: /etc/envoy - -probes: - liveness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 15 - port: 8001 - readiness: - path: /ready - initialDelaySeconds: 5 - periodSeconds: 60 - port: 8001 \ No newline at end of file diff --git a/deploy/k8s/helm/apigwws/envoy.yaml b/deploy/k8s/helm/apigwws/envoy.yaml index 1ae8c45a13..688fb740cc 100644 --- a/deploy/k8s/helm/apigwws/envoy.yaml +++ b/deploy/k8s/helm/apigwws/envoy.yaml @@ -56,6 +56,9 @@ static_resources: auto_host_rewrite: true cluster: signalr-hub timeout: 300s + upgrade_configs: + upgrade_type: "websocket" + enabled: true - name: "b-short" match: prefix: "/b/" diff --git a/deploy/k8s/helm/app.yaml b/deploy/k8s/helm/app.yaml index e83ea28232..acea31ef1c 100644 --- a/deploy/k8s/helm/app.yaml +++ b/deploy/k8s/helm/app.yaml @@ -13,14 +13,10 @@ app: # app global settings spa: "" # ingress entry for web spa status: webstatus # ingress entry for web status webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw - webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator payment: payment-api # ingress entry for payment api - locations: locations-api # ingress entry for locations api - marketing: marketing-api # ingress entry for marketing api webhooks: webhooks-api # ingress entry for webhooks api webhooksweb: webhooks-web # ingress entry for webhooks web demo client svc: @@ -34,13 +30,9 @@ app: # app global settings spa: webspa # service name for web spa status: webstatus # service name for web status webshoppingapigw: webshoppingapigw # service name for web shopping Agw - webmarketingapigw: webmarketingapigw # service name for web mkg Agw - mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw webshoppingagg: webshoppingagg # service name for web shopping aggregator mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator payment: payment-api # service name for payment api - locations: locations-api # service name for locations api - marketing: marketing-api # service name for marketing ap webhooks: webhooks-api # service name for webhooks api webhooksweb: webhooks-client # service name for webhooks web diff --git a/deploy/k8s/helm/basket-api/templates/configmap.yaml b/deploy/k8s/helm/basket-api/templates/configmap.yaml index 2de0e28c79..8a36f74ace 100644 --- a/deploy/k8s/helm/basket-api/templates/configmap.yaml +++ b/deploy/k8s/helm/basket-api/templates/configmap.yaml @@ -12,7 +12,6 @@ metadata: data: basket__ConnectionString: {{ .Values.inf.redis.basket.constr }} urls__IdentityUrl: http://{{ .Values.app.svc.identity }} - basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" \ No newline at end of file diff --git a/deploy/k8s/helm/basket-api/values.yaml b/deploy/k8s/helm/basket-api/values.yaml index 121de02def..dcd6aa763b 100644 --- a/deploy/k8s/helm/basket-api/values.yaml +++ b/deploy/k8s/helm/basket-api/values.yaml @@ -36,8 +36,6 @@ env: key: all__UseAzureServiceBus - name: IdentityUrl key: urls__IdentityUrl - - name: UseLoadTest - key: basket__EnableLoadTest # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) values: - name: OrchestratorType diff --git a/deploy/k8s/helm/deploy-all-mac.ps1 b/deploy/k8s/helm/deploy-all-mac.ps1 index c74b7e05ef..3de7dc6c62 100644 --- a/deploy/k8s/helm/deploy-all-mac.ps1 +++ b/deploy/k8s/helm/deploy-all-mac.ps1 @@ -120,8 +120,8 @@ if (-not [string]::IsNullOrEmpty($registry)) { Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green $infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data") -$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") -$gateways = ("apigwmm", "apigwms", "apigwwm", "apigwws") +$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") +$gateways = ("apigwms", "apigwws") if ($deployInfrastructure) { foreach ($infra in $infras) { diff --git a/deploy/k8s/helm/deploy-all.ps1 b/deploy/k8s/helm/deploy-all.ps1 index da04241958..213e60fb72 100644 --- a/deploy/k8s/helm/deploy-all.ps1 +++ b/deploy/k8s/helm/deploy-all.ps1 @@ -119,8 +119,8 @@ if (-not [string]::IsNullOrEmpty($registry)) { Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green $infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data") -$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") -$gateways = ("apigwmm", "apigwms", "apigwwm", "apigwws") +$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web") +$gateways = ("apigwms", "apigwws") if ($deployInfrastructure) { foreach ($infra in $infras) { diff --git a/deploy/k8s/helm/deploy-all.sh b/deploy/k8s/helm/deploy-all.sh index bf07105ef6..4b4c8eafd3 100644 --- a/deploy/k8s/helm/deploy-all.sh +++ b/deploy/k8s/helm/deploy-all.sh @@ -142,7 +142,7 @@ fi if [[ $push_images ]]; then echo "#################### Pushing images to the container registry ####################" - services=(basket.api catalog.api identity.api ordering.api marketing.api payment.api locations.api webmvc webspa webstatus) + services=(basket.api catalog.api identity.api ordering.api payment.api webmvc webspa webstatus) if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then image_tag=linux-$image_tag @@ -209,7 +209,7 @@ fi echo "#################### Begin $app_name installation using Helm ####################" infras=(sql-data nosql-data rabbitmq keystore-data basket-data) -charts=(eshop-common apigwmm apigwms apigwwm apigwws basket-api catalog-api identity-api locations-api marketing-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web) +charts=(eshop-common apigwms apigwws basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web) if [[ !$skip_infrastructure ]]; then for infra in "${infras[@]}" diff --git a/deploy/k8s/helm/identity-api/templates/configmap.yaml b/deploy/k8s/helm/identity-api/templates/configmap.yaml index 264ceb7457..7c670f6469 100644 --- a/deploy/k8s/helm/identity-api/templates/configmap.yaml +++ b/deploy/k8s/helm/identity-api/templates/configmap.yaml @@ -2,8 +2,6 @@ {{- $sqlsrv := include "sql-name" . -}} {{- $mvc_url := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} {{- $spa_url := include "url-of" (list .Values.app.ingress.entries.spa .) -}} -{{- $locations_url := include "url-of" (list .Values.app.ingress.entries.locations .) -}} -{{- $marketing_url := include "url-of" (list .Values.app.ingress.entries.marketing .) -}} {{- $basket_url := include "url-of" (list .Values.app.ingress.entries.basket .) -}} {{- $ordering_url := include "url-of" (list .Values.app.ingress.entries.ordering .) -}} {{- $mobileshoppingagg := include "url-of" (list .Values.app.ingress.entries.mobileshoppingagg .) -}} @@ -27,8 +25,6 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" mvc_e: http://{{ $mvc_url }} spa_e: http://{{ $spa_url }} - locations_e: http://{{ $locations_url }} - marketing_e: http://{{ $marketing_url }} basket_e: http://{{ $basket_url }} ordering_e: http://{{ $ordering_url }} mobileshoppingagg_e: http://{{ $mobileshoppingagg }} diff --git a/deploy/k8s/helm/identity-api/values.yaml b/deploy/k8s/helm/identity-api/values.yaml index 7b57dfde11..92fd57283b 100644 --- a/deploy/k8s/helm/identity-api/values.yaml +++ b/deploy/k8s/helm/identity-api/values.yaml @@ -40,10 +40,6 @@ env: key: mvc_e - name: SpaClient key: spa_e - - name: LocationApiClient - key: locations_e - - name: MarketingApiClient - key: marketing_e - name: BasketApiClient key: basket_e - name: OrderingApiClient diff --git a/deploy/k8s/helm/inf.yaml b/deploy/k8s/helm/inf.yaml index 938be3d45e..3e0b589c03 100644 --- a/deploy/k8s/helm/inf.yaml +++ b/deploy/k8s/helm/inf.yaml @@ -19,16 +19,10 @@ inf: db: OrderingDb # Ordering API SQL db name identity: db: IdentityDb # Ordering API SQL db name - marketing: - db: MarketingDb # Marketing API SQL db name webhooks: db: WebhooksDb # Webhooks DB mongo: -# host: my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used - locations: - database: LocationsDb - marketing: - database: MarketingDb + host: #my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used redis: # inf.redis defines the redis' connection strings basket: svc: basket-data # Name of k8s svc for basket redis @@ -46,7 +40,6 @@ inf: dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED local: false # True when deploying on "local K8s" provided by Docker Desktop. misc: # inf.misc contains miscellaneous configuration related to infrastructure - useLoadTest: false # If running under loading test or not useAzureStorage: false # If catalog api uses azure storage or not # registry: # Uncomment "registry" to specify registry secret # secretName: # secretName is the name of the secret inside k8s diff --git a/deploy/k8s/helm/locations-api/.helmignore b/deploy/k8s/helm/locations-api/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/helm/locations-api/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/helm/locations-api/Chart.yaml b/deploy/k8s/helm/locations-api/Chart.yaml deleted file mode 100644 index 5126fe847c..0000000000 --- a/deploy/k8s/helm/locations-api/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: locations-api -version: 0.1.0 diff --git a/deploy/k8s/helm/locations-api/templates/NOTES.txt b/deploy/k8s/helm/locations-api/templates/NOTES.txt deleted file mode 100644 index 3b48889bf7..0000000000 --- a/deploy/k8s/helm/locations-api/templates/NOTES.txt +++ /dev/null @@ -1,9 +0,0 @@ -eShop Locations API installed. ------------------------------- - -This API is not directly exposed outside cluster. If need to access it use: - -export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "locations-api.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -echo "Visit http://127.0.0.1:8080 to use your application" -kubectl port-forward $POD_NAME 8080:80 - diff --git a/deploy/k8s/helm/locations-api/templates/_helpers.tpl b/deploy/k8s/helm/locations-api/templates/_helpers.tpl deleted file mode 100644 index 086a461baf..0000000000 --- a/deploy/k8s/helm/locations-api/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "locations-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "locations-api.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "locations-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/helm/locations-api/templates/_names.tpl b/deploy/k8s/helm/locations-api/templates/_names.tpl deleted file mode 100644 index d44859fea8..0000000000 --- a/deploy/k8s/helm/locations-api/templates/_names.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/locations-api/templates/configmap.yaml b/deploy/k8s/helm/locations-api/templates/configmap.yaml deleted file mode 100644 index c5d7525090..0000000000 --- a/deploy/k8s/helm/locations-api/templates/configmap.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- $name := include "locations-api.fullname" . -}} -{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} -{{- $mongo := include "mongo-name" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - all__EventBusConnection: {{ .Values.inf.eventbus.constr }} - all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" - internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }} - urls__IdentityUrl: {{ $identity }} - locations__ConnectionString: mongodb://{{ $mongo }} - locations__Database: {{ .Values.inf.mongo.locations.database }} \ No newline at end of file diff --git a/deploy/k8s/helm/locations-api/templates/deployment.yaml b/deploy/k8s/helm/locations-api/templates/deployment.yaml deleted file mode 100644 index 1dba5d166b..0000000000 --- a/deploy/k8s/helm/locations-api/templates/deployment.yaml +++ /dev/null @@ -1,96 +0,0 @@ -{{- $name := include "locations-api.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "locations-api.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/helm/locations-api/templates/service.yaml b/deploy/k8s/helm/locations-api/templates/service.yaml deleted file mode 100644 index abd628beb5..0000000000 --- a/deploy/k8s/helm/locations-api/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.locations }} - labels: - app: {{ template "locations-api.name" . }} - chart: {{ template "locations-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "locations-api.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/helm/locations-api/values.yaml b/deploy/k8s/helm/locations-api/values.yaml deleted file mode 100644 index 4718f2a0bb..0000000000 --- a/deploy/k8s/helm/locations-api/values.yaml +++ /dev/null @@ -1,66 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /locations-api - -image: - repository: eshop/locations.api - tag: latest - pullPolicy: IfNotPresent - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: {} - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: ApplicationInsights__InstrumentationKey - key: all__InstrumentationKey - - name: EventBusConnection - key: all__EventBusConnection - - name: AzureServiceBusEnabled - key: all__UseAzureServiceBus - - name: UseLoadTest - key: all_EnableLoadTest - - name: IdentityUrl - key: internalurls__IdentityUrl - - name: IdentityUrlExternal - key: urls__IdentityUrl - - name: ConnectionString - key: locations__ConnectionString - - name: Database - key: locations__Database - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development - - name: OrchestratorType - value: 'K8S' -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 diff --git a/deploy/k8s/helm/marketing-api/.helmignore b/deploy/k8s/helm/marketing-api/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/deploy/k8s/helm/marketing-api/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/deploy/k8s/helm/marketing-api/Chart.yaml b/deploy/k8s/helm/marketing-api/Chart.yaml deleted file mode 100644 index 173f94fd64..0000000000 --- a/deploy/k8s/helm/marketing-api/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: marketing-api -version: 0.1.0 diff --git a/deploy/k8s/helm/marketing-api/templates/NOTES.txt b/deploy/k8s/helm/marketing-api/templates/NOTES.txt deleted file mode 100644 index 7fa66ed472..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/NOTES.txt +++ /dev/null @@ -1,9 +0,0 @@ -eShop Marketing API installed. ------------------------------- - -This API is not directly exposed outside cluster. If need to access it use: - -export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "marketing-api.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -echo "Visit http://127.0.0.1:8080 to use your application" -kubectl port-forward $POD_NAME 8080:80 - diff --git a/deploy/k8s/helm/marketing-api/templates/_helpers.tpl b/deploy/k8s/helm/marketing-api/templates/_helpers.tpl deleted file mode 100644 index c252aeeacf..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "marketing-api.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "marketing-api.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "marketing-api.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/deploy/k8s/helm/marketing-api/templates/_names.tpl b/deploy/k8s/helm/marketing-api/templates/_names.tpl deleted file mode 100644 index 605e92e7ee..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/_names.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{- define "suffix-name" -}} -{{- if .Values.app.name -}} -{{- .Values.app.name -}} -{{- else -}} -{{- .Release.Name -}} -{{- end -}} -{{- end -}} - -{{- define "sql-name" -}} -{{- if .Values.inf.sql.host -}} -{{- .Values.inf.sql.host -}} -{{- else -}} -{{- printf "%s" "sql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "mongo-name" -}} -{{- if .Values.inf.mongo.host -}} -{{- .Values.inf.mongo.host -}} -{{- else -}} -{{- printf "%s" "nosql-data" -}} -{{- end -}} -{{- end -}} - -{{- define "url-of" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if eq $name "" -}} -{{- $ctx.Values.inf.k8s.dns -}} -{{- else -}} -{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just / */}} -{{- end -}} -{{- end -}} - - - -{{- define "pathBase" -}} -{{- if .Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" . -}} -{{- printf "%s-%s" .Values.pathBase $suffix -}} -{{- else -}} -{{- .Values.pathBase -}} -{{- end -}} -{{- end -}} - -{{- define "fqdn-image" -}} -{{- if .Values.inf.registry -}} -{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} -{{- else -}} -{{- .Values.image.repository -}} -{{- end -}} -{{- end -}} - -{{- define "protocol" -}} -{{- if .Values.inf.tls.enabled -}} -{{- printf "%s" "https" -}} -{{- else -}} -{{- printf "%s" "http" -}} -{{- end -}} -{{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/marketing-api/templates/configmap.yaml b/deploy/k8s/helm/marketing-api/templates/configmap.yaml deleted file mode 100644 index e6b495a7a0..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/configmap.yaml +++ /dev/null @@ -1,27 +0,0 @@ -{{- $name := include "marketing-api.fullname" . -}} -{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} -{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} -{{- $mongo := include "mongo-name" . -}} -{{- $sqlsrv := include "sql-name" . -}} -{{- $protocol := include "protocol" . -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: "cfg-{{ $name }}" - labels: - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" .}} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: - all__EventBusConnection: {{ .Values.inf.eventbus.constr }} - all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" - internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }} - urls__IdentityUrl: {{ $protocol }}://{{ $identity }} - marketing__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.marketing.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; - marketing__MongoConnectionString: mongodb://{{ $mongo }} - marketing__MongoDatabase: {{ .Values.inf.mongo.marketing.database }} - marketing__PicBaseUrl: {{ $protocol }}://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/ \ No newline at end of file diff --git a/deploy/k8s/helm/marketing-api/templates/deployment.yaml b/deploy/k8s/helm/marketing-api/templates/deployment.yaml deleted file mode 100644 index 6b833eb8c6..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/deployment.yaml +++ /dev/null @@ -1,96 +0,0 @@ -{{- $name := include "marketing-api.fullname" . -}} -{{- $cfgname := printf "%s-%s" "cfg" $name -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "marketing-api.fullname" . }} - labels: - ufo: {{ $cfgname}} - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} - {{ if .Values.inf.mesh.enabled -}} - annotations: - linkerd.io/inject: enabled - {{- end }} - spec: - {{ if .Values.inf.registry -}} - imagePullSecrets: - - name: {{ .Values.inf.registry.secretName }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{ if .Values.probes -}} - {{- if .Values.probes.liveness -}} - livenessProbe: - httpGet: - port: {{ .Values.probes.liveness.port }} - path: {{ .Values.probes.liveness.path }} - initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.liveness.periodSeconds }} - {{- end -}} - {{- end -}} - {{- if .Values.probes -}} - {{- if .Values.probes.readiness }} - readinessProbe: - httpGet: - port: {{ .Values.probes.readiness.port }} - path: {{ .Values.probes.readiness.path }} - initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} - periodSeconds: {{ .Values.probes.readiness.periodSeconds }} - timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} - {{- end -}} - {{- end }} - image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: PATH_BASE - value: {{ include "pathBase" . }} - - name: k8sname - value: {{ .Values.clusterName }} - {{- if .Values.env.values -}} - {{- range .Values.env.values }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end -}} - {{- end -}} - {{- if .Values.env.configmap -}} - {{- range .Values.env.configmap }} - - name: {{ .name }} - valueFrom: - configMapKeyRef: - name: {{ $cfgname }} - key: {{ .key }} - {{- end -}} - {{- end }} - ports: - - name: http - containerPort: 80 - protocol: TCP - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} - diff --git a/deploy/k8s/helm/marketing-api/templates/service.yaml b/deploy/k8s/helm/marketing-api/templates/service.yaml deleted file mode 100644 index 0e9bfbea27..0000000000 --- a/deploy/k8s/helm/marketing-api/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.app.svc.marketing }} - labels: - app: {{ template "marketing-api.name" . }} - chart: {{ template "marketing-api.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "marketing-api.name" . }} - release: {{ .Release.Name }} diff --git a/deploy/k8s/helm/marketing-api/values.yaml b/deploy/k8s/helm/marketing-api/values.yaml deleted file mode 100644 index 00bebf27fe..0000000000 --- a/deploy/k8s/helm/marketing-api/values.yaml +++ /dev/null @@ -1,70 +0,0 @@ -replicaCount: 1 -clusterName: eshop-aks -pathBase: /marketing-api - -image: - repository: eshop/marketing.api - tag: latest - pullPolicy: IfNotPresent - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: {} - tls: [] - -resources: {} - - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -# env defines the environment variables that will be declared in the pod -env: - urls: - # configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). - configmap: - - name: ApplicationInsights__InstrumentationKey - key: all__InstrumentationKey - - name: EventBusConnection - key: all__EventBusConnection - - name: AzureServiceBusEnabled - key: all__UseAzureServiceBus - - name: UseLoadTest - key: all_EnableLoadTest - - name: IdentityUrl - key: internalurls__IdentityUrl - - name: IdentityUrlExternal - key: urls__IdentityUrl - - name: ConnectionString - key: marketing__ConnectionString - - name: MongoConnectionString - key: marketing__MongoConnectionString - - name: MongoDatabase - key: marketing__MongoDatabase - - name: PicBaseUrl - key: marketing__PicBaseUrl - # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) - values: - - name: ASPNETCORE_ENVIRONMENT - value: Development - - name: OrchestratorType - value: 'K8S' -probes: - liveness: - path: /liveness - initialDelaySeconds: 10 - periodSeconds: 15 - port: 80 - readiness: - path: /hc - timeoutSeconds: 5 - initialDelaySeconds: 90 - periodSeconds: 60 - port: 80 diff --git a/deploy/k8s/helm/mobileshoppingagg/templates/NOTES.txt b/deploy/k8s/helm/mobileshoppingagg/templates/NOTES.txt index 61971f717f..e7e5081ea3 100644 --- a/deploy/k8s/helm/mobileshoppingagg/templates/NOTES.txt +++ b/deploy/k8s/helm/mobileshoppingagg/templates/NOTES.txt @@ -1,4 +1,4 @@ -eShop Mobile Marketing Aggregator is installed +eShop Mobile Shopping Aggregator is installed ---------------------------------------------- This API is not directly exposed outside cluster. If need to access it use: diff --git a/deploy/k8s/helm/mobileshoppingagg/templates/_names.tpl b/deploy/k8s/helm/mobileshoppingagg/templates/_names.tpl index d44859fea8..605e92e7ee 100644 --- a/deploy/k8s/helm/mobileshoppingagg/templates/_names.tpl +++ b/deploy/k8s/helm/mobileshoppingagg/templates/_names.tpl @@ -49,4 +49,12 @@ {{- else -}} {{- .Values.image.repository -}} {{- end -}} +{{- end -}} + +{{- define "protocol" -}} +{{- if .Values.inf.tls.enabled -}} +{{- printf "%s" "https" -}} +{{- else -}} +{{- printf "%s" "http" -}} +{{- end -}} {{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml b/deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml index 1ca69509ff..cc66723d4e 100644 --- a/deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml +++ b/deploy/k8s/helm/mobileshoppingagg/templates/configmap.yaml @@ -1,4 +1,6 @@ {{- $name := include "mobileshoppingagg.fullname" . -}} +{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} +{{- $protocol := include "protocol" . -}} apiVersion: v1 kind: ConfigMap @@ -11,7 +13,6 @@ metadata: heritage: {{ .Release.Service }} data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__catalog: http://{{ .Values.app.svc.catalog }} @@ -21,9 +22,8 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}" internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}" internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}" + urls__IdentityUrlExternal: {{ $protocol }}://{{ $identity }} diff --git a/deploy/k8s/helm/mobileshoppingagg/values.yaml b/deploy/k8s/helm/mobileshoppingagg/values.yaml index 844a59441f..960601da0d 100644 --- a/deploy/k8s/helm/mobileshoppingagg/values.yaml +++ b/deploy/k8s/helm/mobileshoppingagg/values.yaml @@ -49,18 +49,16 @@ env: key: internalurls__identity__hc - name: OrderingUrlHC key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - name: PaymentUrlHC key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - name: urls__grpcBasket key: internalurls__grpcBasket - name: urls__grpcCatalog key: internalurls__grpcCatalog - name: urls__grpcOrdering key: internalurls__grpcOrdering + - name: IdentityUrlExternal + key: urls__IdentityUrlExternal # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) values: - name: ASPNETCORE_ENVIRONMENT diff --git a/deploy/k8s/helm/ordering-api/templates/configmap.yaml b/deploy/k8s/helm/ordering-api/templates/configmap.yaml index e64a6c8413..e93dddd5cb 100644 --- a/deploy/k8s/helm/ordering-api/templates/configmap.yaml +++ b/deploy/k8s/helm/ordering-api/templates/configmap.yaml @@ -12,7 +12,6 @@ metadata: heritage: {{ .Release.Service }} data: ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; - ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" urls__IdentityUrl: http://{{ .Values.app.svc.identity }} all__EventBusConnection: {{ .Values.inf.eventbus.constr }} all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" diff --git a/deploy/k8s/helm/ordering-api/values.yaml b/deploy/k8s/helm/ordering-api/values.yaml index 7eff1a48b1..505ccc3793 100644 --- a/deploy/k8s/helm/ordering-api/values.yaml +++ b/deploy/k8s/helm/ordering-api/values.yaml @@ -41,8 +41,6 @@ env: key: all__EventBusConnection - name: AzureServiceBusEnabled key: all__UseAzureServiceBus - - name: UseLoadTest - key: ordering__EnableLoadTest - name: IdentityUrl key: urls__IdentityUrl # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) diff --git a/deploy/k8s/helm/ordering-backgroundtasks/values.yaml b/deploy/k8s/helm/ordering-backgroundtasks/values.yaml index d065f03451..18abe99a53 100644 --- a/deploy/k8s/helm/ordering-backgroundtasks/values.yaml +++ b/deploy/k8s/helm/ordering-backgroundtasks/values.yaml @@ -44,8 +44,6 @@ env: key: all__EventBusConnection - name: AzureServiceBusEnabled key: all__UseAzureServiceBus - - name: UseLoadTest - key: ordering__EnableLoadTest - name: CheckUpdateTime key: graceperiodmanager__CheckUpdateTime - name: GracePeriodTime diff --git a/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml b/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml index bab4ebc945..98e94b3c3a 100644 --- a/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml +++ b/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml @@ -15,4 +15,4 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }} - urls__IdentityUrl: http://{{ $identity }} \ No newline at end of file + urls__IdentityUrl: http://identity-api \ No newline at end of file diff --git a/deploy/k8s/helm/sql-data/values.yaml b/deploy/k8s/helm/sql-data/values.yaml index 0ed76556a8..762a6748eb 100644 --- a/deploy/k8s/helm/sql-data/values.yaml +++ b/deploy/k8s/helm/sql-data/values.yaml @@ -1,8 +1,8 @@ replicaCount: 1 image: - repository: microsoft/mssql-server-linux - tag: 2017-CU7 + repository: mcr.microsoft.com/mssql/server + tag: 2019-latest pullPolicy: IfNotPresent service: diff --git a/deploy/k8s/helm/webmvc/templates/configmap.yaml b/deploy/k8s/helm/webmvc/templates/configmap.yaml index 2aa06fc7f1..2062bdabc2 100644 --- a/deploy/k8s/helm/webmvc/templates/configmap.yaml +++ b/deploy/k8s/helm/webmvc/templates/configmap.yaml @@ -16,10 +16,8 @@ metadata: data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webmvc__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} - internalurls__apigwwm: http://{{ .Values.app.svc.webmarketingapigw }} internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc urls__apigwws: {{ $protocol }}://{{ $webshoppingapigw }} urls__mvc: {{ $protocol }}://{{ $mvc }} diff --git a/deploy/k8s/helm/webmvc/values.yaml b/deploy/k8s/helm/webmvc/values.yaml index 973f187f5b..1f40dbb039 100644 --- a/deploy/k8s/helm/webmvc/values.yaml +++ b/deploy/k8s/helm/webmvc/values.yaml @@ -32,8 +32,6 @@ env: configmap: - name: ApplicationInsights__InstrumentationKey key: all__InstrumentationKey - - name: UseLoadTest - key: all_EnableLoadTest - name: DPConnectionString key: webmvc__keystore - name: PurchaseUrl @@ -44,8 +42,6 @@ env: key: urls__mvc - name: IdentityUrl key: urls__IdentityUrl - - name: MarketingUrl - key: internalurls__apigwwm - name: IdentityUrlHC key: internalurls__identity__hc - name: SignalrHubUrl diff --git a/deploy/k8s/helm/webshoppingagg/templates/_names.tpl b/deploy/k8s/helm/webshoppingagg/templates/_names.tpl index d44859fea8..605e92e7ee 100644 --- a/deploy/k8s/helm/webshoppingagg/templates/_names.tpl +++ b/deploy/k8s/helm/webshoppingagg/templates/_names.tpl @@ -49,4 +49,12 @@ {{- else -}} {{- .Values.image.repository -}} {{- end -}} +{{- end -}} + +{{- define "protocol" -}} +{{- if .Values.inf.tls.enabled -}} +{{- printf "%s" "https" -}} +{{- else -}} +{{- printf "%s" "http" -}} +{{- end -}} {{- end -}} \ No newline at end of file diff --git a/deploy/k8s/helm/webshoppingagg/templates/configmap.yaml b/deploy/k8s/helm/webshoppingagg/templates/configmap.yaml index d01de8dcdd..0bfb690c17 100644 --- a/deploy/k8s/helm/webshoppingagg/templates/configmap.yaml +++ b/deploy/k8s/helm/webshoppingagg/templates/configmap.yaml @@ -1,4 +1,6 @@ {{- $name := include "webshoppingagg.fullname" . -}} +{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} +{{- $protocol := include "protocol" . -}} apiVersion: v1 kind: ConfigMap @@ -11,7 +13,6 @@ metadata: heritage: {{ .Release.Service }} data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__basket: http://{{ .Values.app.svc.basket }} internalurls__catalog: http://{{ .Values.app.svc.catalog }} @@ -21,9 +22,8 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc - internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}" internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}" internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}" + urls__IdentityUrlExternal: {{ $protocol }}://{{ $identity }} diff --git a/deploy/k8s/helm/webshoppingagg/values.yaml b/deploy/k8s/helm/webshoppingagg/values.yaml index 15501c727b..b85210afa5 100644 --- a/deploy/k8s/helm/webshoppingagg/values.yaml +++ b/deploy/k8s/helm/webshoppingagg/values.yaml @@ -49,18 +49,16 @@ env: key: internalurls__identity__hc - name: OrderingUrlHC key: internalurls__ordering__hc - - name: MarketingUrlHC - key: internalurls__marketing__hc - name: PaymentUrlHC key: internalurls__payment__hc - - name: LocationUrlHC - key: internalurls__location__hc - name: urls__grpcBasket key: internalurls__grpcBasket - name: urls__grpcCatalog key: internalurls__grpcCatalog - name: urls__grpcOrdering key: internalurls__grpcOrdering + - name: IdentityUrlExternal + key: urls__IdentityUrlExternal # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) values: diff --git a/deploy/k8s/helm/webspa/templates/configmap.yaml b/deploy/k8s/helm/webspa/templates/configmap.yaml index ecdbf8b633..e5ca69308e 100644 --- a/deploy/k8s/helm/webspa/templates/configmap.yaml +++ b/deploy/k8s/helm/webspa/templates/configmap.yaml @@ -1,7 +1,6 @@ {{- $name := include "webspa.fullname" . -}} {{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} -{{- $webmarketingapigw := include "url-of" (list .Values.app.ingress.entries.webmarketingapigw .) -}} {{- $spa := include "url-of" (list .Values.app.ingress.entries.spa .) -}} {{- $mongo := include "mongo-name" . -}} {{- $protocol := include "protocol" . -}} @@ -17,11 +16,9 @@ metadata: heritage: {{ .Release.Service }} data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webspa__keystore: {{ .Values.inf.redis.keystore.constr }} internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }} internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc urls__apigwws: {{ $protocol }}://{{ $webshoppingapigw }} urls__spa: {{ $protocol }}://{{ $spa }} - urls__IdentityUrl: {{ $protocol }}://{{ $identity }} - urls__apigwwm: {{ $protocol }}://{{ $webmarketingapigw }} \ No newline at end of file + urls__IdentityUrl: {{ $protocol }}://{{ $identity }} \ No newline at end of file diff --git a/deploy/k8s/helm/webspa/values.yaml b/deploy/k8s/helm/webspa/values.yaml index e1547ed394..08e1481111 100644 --- a/deploy/k8s/helm/webspa/values.yaml +++ b/deploy/k8s/helm/webspa/values.yaml @@ -32,8 +32,6 @@ env: configmap: - name: ApplicationInsights__InstrumentationKey key: all__InstrumentationKey - - name: UseLoadTest - key: all_EnableLoadTest - name: DPConnectionString key: webspa__keystore - name: PurchaseUrl @@ -42,8 +40,6 @@ env: key: urls__spa - name: IdentityUrl key: urls__IdentityUrl - - name: MarketingUrl - key: urls__apigwwm - name: IdentityUrlHC key: internalurls__identity__hc - name: SignalrHubUrl diff --git a/deploy/k8s/helm/webstatus/templates/configmap.yaml b/deploy/k8s/helm/webstatus/templates/configmap.yaml index bf40d2a7d1..60bd414891 100644 --- a/deploy/k8s/helm/webstatus/templates/configmap.yaml +++ b/deploy/k8s/helm/webstatus/templates/configmap.yaml @@ -16,7 +16,6 @@ metadata: data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" - all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}" webstatus__keystore: {{ .Values.inf.redis.keystore.constr }} name__mvc__hc: WebMVC HTTP Check internalurls__mvc__hc: http://{{ .Values.app.svc.mvc }}/hc @@ -24,12 +23,8 @@ data: internalurls__spa__hc: http://{{ .Values.app.svc.spa }}/hc name__apigwws__hc: Web Shopping API GW HTTP Check internalurls__apigwws__hc: http://{{ .Values.app.svc.webshoppingapigw }}:8001/ready - name__apigwwm__hc: Web Marketing API GW HTTP Check - internalurls__apigwwm__hc: http://{{ .Values.app.svc.webmarketingapigw }}:8001/ready name__apigwms__hc: Mobile Shopping API GW HTTP Check internalurls__apigwms__hc: http://{{ .Values.app.svc.mobileshoppingapigw }}:8001/ready - name__apigwmm__hc: Mobile Marketing API GW HTTP Check - internalurls__apigwmm__hc: http://{{ .Values.app.svc.mobilemarketingapigw }}:8001/ready name__apigwwsagg__hc: Web Shopping Aggregator GW HTTP Check internalurls__apigwwsagg__hc: http://{{ .Values.app.svc.webshoppingagg }}/hc name__apigwmsagg__hc: Mobile Shopping Aggregator HTTP Check @@ -44,10 +39,6 @@ data: internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc name__identity__hc: Identity HTTP Check internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc - name__marketing__hc: Marketing HTTP Check - internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc - name__locations__hc: Locations HTTP Check - internalurls__locations__hc: http://{{ .Values.app.svc.locations }}/hc name__payment__hc: Payment HTTP Check internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc name__signalrhub__hc: Ordering SignalR Hub HTTP Check diff --git a/deploy/k8s/helm/webstatus/values.yaml b/deploy/k8s/helm/webstatus/values.yaml index e5a23ec857..1ce23fec36 100644 --- a/deploy/k8s/helm/webstatus/values.yaml +++ b/deploy/k8s/helm/webstatus/values.yaml @@ -67,24 +67,16 @@ env: - name: HealthChecks-UI__HealthChecks__7__Uri key: internalurls__identity__hc - name: HealthChecks-UI__HealthChecks__8__Name - key: name__marketing__hc - - name: HealthChecks-UI__HealthChecks__8__Uri - key: internalurls__marketing__hc - - name: HealthChecks-UI__HealthChecks__9__Name - key: name__locations__hc - - name: HealthChecks-UI__HealthChecks__9__Uri - key: internalurls__locations__hc - - name: HealthChecks-UI__HealthChecks__10__Name key: name__payment__hc - - name: HealthChecks-UI__HealthChecks__10__Uri + - name: HealthChecks-UI__HealthChecks__8__Uri key: internalurls__payment__hc - - name: HealthChecks-UI__HealthChecks__11__Name + - name: HealthChecks-UI__HealthChecks__9__Name key: name__signalrhub__hc - - name: HealthChecks-UI__HealthChecks__11__Uri + - name: HealthChecks-UI__HealthChecks__9__Uri key: internalurls__signalrhub__hc - - name: HealthChecks-UI__HealthChecks__12__Name + - name: HealthChecks-UI__HealthChecks__10__Name key: name__orderingbackground__hc - - name: HealthChecks-UI__HealthChecks__12__Uri + - name: HealthChecks-UI__HealthChecks__10__Uri key: internalurls__orderingbackground__hc # values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) diff --git a/github-actions.md b/github-actions.md new file mode 100644 index 0000000000..d1f8d815ca --- /dev/null +++ b/github-actions.md @@ -0,0 +1,8 @@ +# eShopOnContainers - GitHub Actions + +To configure the github actions it is necessary to add the following secrets to the github repository: + +- `USERNAME` : Container registry user. +- `PASSWORD` : Container registry password. +- `REGISTRY_ENDPOINT` : Container registry name (eshop in the official repo https://hub.docker.com/u/eshop). +- `REGISTRY_HOST` : docker.io for Docker Hub. diff --git a/img/eShopOnContainers-architecture.png b/img/eShopOnContainers-architecture.png index f97b157eb3..12d0f2afeb 100644 Binary files a/img/eShopOnContainers-architecture.png and b/img/eShopOnContainers-architecture.png differ diff --git a/obsolete/KUBERNETES.md b/obsolete/KUBERNETES.md deleted file mode 100644 index 6e107b3a1d..0000000000 --- a/obsolete/KUBERNETES.md +++ /dev/null @@ -1,134 +0,0 @@ -# Kubernetes 101 -## Docker vs. Kubernetes -Docker helps you package applications into images, and execute them in containers. Kubernetes is a robust platform for containerized applications. It abstracts away the underlying network infrastructure and hardware required to run them, simplifying their deployment, scaling, and management. - -## Kubernetes from the container up -### Pods -The basic unit of a Kubernetes deployment is the **Pod**. A Pod encapsulates one or more containers. For example, the `basket` Pod specifies two containers: ->`deployments.yaml` -> ->The first container runs the `eshop/basket.api` image: ->```yaml ->spec: -> containers: -> - name: basket -> image: eshop/basket.api -> env: -> - name: ConnectionString -> value: 127.0.0.1 ->``` ->Note the `ConnectionString` environment variable: containers within a Pod are networked via `localhost`. The second container runs the `redis` image: ->```yaml ->- name: basket-data -> image: redis:3.2-alpine -> ports: -> - containerPort: 6379 ->``` -Placing `basket` and `basket-data` in the same Pod is reasonable here because the former requires the latter, and owns all its data. If we wanted to scale the service, however, it would be better to place the containers in separate Pods because the basket API and redis scale at different rates. - -If the containers were in separate Pods, they would no longer be able to communicate via `localhost`; a **Service** would be required. - -### Services -Services expose Pods to external networks. For example, the `basket` Service exposes Pods with labels `app=eshop` and `component=basket` to the cluster at large: ->`services.yaml` ->```yaml ->kind: Service ->metadata: -> ... -> name: basket ->spec: -> ports: -> - port: 80 -> selector: -> app: eshop -> component: basket ->``` -Kubernetes's built-in DNS service resolves Service names to cluster-internal IP addresses. This allows the nginx frontend to proxy connections to the app's microservices by name: ->`nginx.conf` ->``` ->location /basket-api { -> proxy_pass http://basket; ->``` -The frontend Pod is different in that it needs to be exposed outside the cluster. This is accomplished with another Service: ->`frontend.yaml` ->```yaml ->spec: -> ports: -> - port: 80 -> targetPort: 8080 -> selector: -> app: eshop -> component: frontend -> type: LoadBalancer ->``` -`type: LoadBalancer` tells Kubernetes to expose the Service behind a load balancer appropriate for the cluster's platform. For Azure Container Service, this creates an Azure load balancer rule with a public IP. - -### Deployments -Kubernetes uses Pods to organize containers, and Services to network them. It uses **Deployments** to organize creating, and modifying, Pods. A Deployment describes a state of one or more Pods. When a Deployment is created or modified, Kubernetes attempts to realize that state. - -The Deployments in this project are basic. Still, `deploy.ps1` shows some more advanced Deployment capabilities. For example, Deployments can be paused. Each Deployment of this app is paused at creation: ->`deployments.yaml` ->```yaml ->kind: Deployment ->spec: -> paused: true ->``` -This allows the deployment script to change images before Kubernetes creates the Pods: ->`deploy.ps1` ->```powershell ->kubectl set image -f deployments.yaml basket=$registry/basket.api ... ->kubectl rollout resume -f deployments.yaml ->``` - -### ConfigMaps -A **ConfigMap** is a collection of key/value pairs commonly used to provide configuration information to Pods. The deployment script uses one to store the frontend's configuration: ->`deploy.ps1` ->``` ->kubectl create configmap config-files from-file=nginx-conf=nginx.conf ->``` -This creates a ConfigMap named `config-files` with key `nginx-conf` whose value is the content of nginx.conf. The frontend Pod mounts that value as `/etc/nginx/nginx.conf`: ->`frontend.yaml` ->```yaml ->spec: -> containers: -> - name: nginx -> ... -> volumeMounts: -> - name: config -> mountPath: /etc/nginx -> volumes: -> - name: config -> configMap: -> name: config-files -> items: -> - key: nginx-conf -> path: nginx.conf ->``` -This facilitates rapid iteration better than other techniques, e.g. building an image to bake in configuration. - -The script also stores public URLs for the app's components in a ConfigMap: ->`deploy.ps1` ->```powershell ->kubectl create configmap urls --from-literal=BasketUrl=http://$($frontendUrl)/basket-api ... ->``` ->Here's how the `webspa` Deployment uses it: -> ->`deployments.yaml` ->```yaml ->spec: -> containers: -> - name: webspa -> ... -> env: -> ... -> - name: BasketUrl -> valueFrom: -> configMapKeyRef: -> name: urls -> key: BasketUrl ->``` - -### Further reading -* [Kubernetes Concepts](https://kubernetes.io/docs/concepts/) -* [kubectl for Docker Users](https://kubernetes.io/docs/user-guide/docker-cli-to-kubectl/) -* [Kubernetes API reference](https://kubernetes.io/docs/api-reference/v1.5/) \ No newline at end of file diff --git a/obsolete/readme/README.ENV.md b/obsolete/readme/README.ENV.md deleted file mode 100644 index bdb436a1a6..0000000000 --- a/obsolete/readme/README.ENV.md +++ /dev/null @@ -1,67 +0,0 @@ -**Note**: It is very important to disable any ESHOP_AZURE variables from .env file when the local storage or container services is set. Remember you can disable any variable from .env file putting '#' character before the variable declaration and you can run and test separately any Azure services. - -With the steps explained in the next section, you will be able to run the application with Azure Redis Cache instead of the container of Redis service. - -# Azure Redis Cache service -To enable the Redis Cache of Azure in eShop it is necessary to have previously configured the Azure Redis service through ARM file or manually through Azure portal. You can use the [ARM files](deploy/az/redis/readme.md) already created in eShop. Once the Redis Cache service is created, it is necessary to get the Primary connection string from information service in the Azure portal and modify the port value from 6380 to 6379 and the ssl value from True to False to establish a without ssl connection with the cache server. This Primary connection must be declared on .env file located in the solution root folder with `ESHOP_AZURE_REDIS_BASKET_DB` variable name. - -For example: ->ESHOP_AZURE_REDIS_BASKET_DB=yourredisservice.redis.cache.windows.net:6379,password=yourredisservicepassword,ssl=False,abortConnect=False - -With the steps explained in the next section, you will be able to run the application with Azure Service Bus instead of the container of RabbitMQ service. - -# Azure Service Bus service -To enable the service bus of Azure in eShop solution it is necessary having created previously the service bus service through ARM file or manually through Azure portal. You can use the [ARM files](deploy/az/servicebus/readme.md) already created in eShop. Finally, it is necessary to get the Shared access policy named "Root" (if you generated the service through ARM file) from eshop_event_bus topic. This policy must be declared on .env file located in the solution root folder with `ESHOP_AZURE_SERVICE_BUS` name. - -For example: ->ESHOP_AZURE_SERVICE_BUS=Endpoint=sb://yourservicebusservice.servicebus.windows.net/;SharedAccessKeyName=Root;SharedAccessKey=yourtopicpolicykey=;EntityPath=eshop_event_bus - -Once the service bus service is created, it is necessary to set to true the "AzureServiceBusEnabled" environment variable from `settings.json` file on Catalog.API, Ordering.API, Basket.API, Payment.API, GracePeriodManager, Marketing.API and Locations.API. - -With the steps explained in the next section, you will be able to run the application with Azure Storage Account instead of the local container storage. - -# Azure Storage Account service -To enable Azure storage of Azure in eShopOnAzure solution it is necessary having created previously the storage service through ARM file or manually through Azure portal. You can use the ARM files find under **deploy/az/storage** folder already created in eShop. Once the storage account is created, it is very important to create a new container(blob kind) and upload the solution catalog pics files before to continue.Later, it is necessary to set to true the "AzureStorageEnabled" environment variable from `settings.json` in Catalog.API and Marketing.API.Finally, it is necessary to get the container endpoint url from information service in the Azure portal, This url must be declared on .env file located in the solution root folder with `ESHOP_AZURE_STORAGE_CATALOG` for the Catalog.API content and `ESHOP_AZURE_STORAGE_MARKETING` for the Marketing.API content. - -Do not forget to put a slash character '/' in the end of the url. - -For example: ->ESHOP_AZURE_STORAGE_CATALOG=https://yourcatalogstorageaccountservice.blob.core.windows.net/yourcontainername/ ->ESHOP_AZURE_STORAGE_MARKETING=https://yourmarketingstorageaccountservice.blob.core.windows.net/yourcontainername/ - - -## Check status of Azure Storage Account with Health Checks -It is possible to add status check for the Azure Storage Account inside the Catalog Web Status. In case that the status check is enabled, for the Catalog and/or Marketing section in the WebStatus page, Azure Storage will be checked as one of the dependencies for theses APIs. To enable this check add the account name and key to the .env file for your account. - -For example: ->ESHOP_AZURE_STORAGE_CATALOG_NAME=storageaccountname ->ESHOP_AZURE_STORAGE_CATALOG_KEY=storageaccountkey ->ESHOP_AZURE_STORAGE_MARKETING_NAME=storageaccountname ->ESHOP_AZURE_STORAGE_MARKETING_KEY=storageaccountkey - -With the steps explained in the next section, you will be able to run the application with Azure SQL Database instead of local storage. - -# Azure SQL Database -To enable Azure SQL Database in eShop is required to have a Azure SQL with the databases for Ordering.API, Identity.API, Catalaog.API and Marketing.API. You can use the [ARM files](deploy/az/sql/readme.md) already created in this project or do it manually. Once the databases are created, it is necessary to get the connection string for each service and set the corresponding variable in the .env file. - -For example: ->ESHOP_AZURE_CATALOG_DB=catalogazureconnectionstring ->ESHOP_AZURE_IDENTITY_DB=identityazureconnectionstring ->ESHOP_AZURE_ORDERING_DB=orderingazureconnectionstring ->ESHOP_AZURE_MARKETING_DB=marketingazureconnectionstring - -With the steps explained in the next section, you will be able to run the application with Azure Cosmos DB Database instead of local storage. - -# Azure Cosmos DB -To enable Azure Cosmos DB in eShop is required to have the connection string. If you do not have an Azure Cosmos DB created you can use the ARM files under **deploy/az/cosmos** folder available in eShop or do it manually. Once the connection string is availabe it is necessary to add it in the .env file in the `ESHOP_AZURE_COSMOSDB`variable. - -For example: ->ESHOP_AZURE_COSMOSDB=cosmosconnectionstring - -# Azure Functions -To enable the Azure Functions in eShop you can add the URI where the functions have been deployed. You can use the ARM files under **deploy/az/azurefunctions** to create the resources in Azure. Once created and available, it is necessary to add to the .env file the `ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI` variable. - -For example: - >ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI=https://marketing-functions.azurewebsites.net/api/MarketingDetailsHttpTrigger?code=AzureFunctioncode - -See Azure Functions deployment Files and Readme for more details [ARM files](deploy/az/azurefunctions/readme.md) \ No newline at end of file diff --git a/obsolete/readme/readme-docker-compose.md b/obsolete/readme/readme-docker-compose.md deleted file mode 100644 index 8826306826..0000000000 --- a/obsolete/readme/readme-docker-compose.md +++ /dev/null @@ -1,86 +0,0 @@ -# Docker-compose yaml files - -In the root folder of the repo are all docker-compose files (`docker-compose*.yml`). Here is a list of all of them and what is their purpose: - -## Files needed to run eShopOnContainers locally - -* `docker-compose.yml`: This file contains **the definition of all images needed for running eShopOnContainers**. -* `docker-compose.override.yml`: This file contains the base configuration for all images of the previous file - -Usually these two files are using together. The standard way to start eShopOnContainers from CLI is: - -``` -docker-compose -f docker-compose.yml -f docker-compose.override.yml -``` - -This will start eShopOnContainers with all containers running locally, and it is the default development environment. - -## Files needed to run eShopOnContainers on a remote docker host - -* `docker-compose.prod.yml`: This file is a replacement of the `docker-compose.override.yml` but contains some configurations more suitable for a "production" environment or when you need to run the services using an external docker host. - -``` -docker-compose -f docker-compose.yml -f docker-compose.prod.yml -``` - -When using this file the following environments variables must be set: - -* `ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP` with the IP or DNS name of the docker host that runs the services (can use `localhost` if needed). -* `ESHOP_AZURE_STORAGE_CATALOG` with the URL of the Azure Storage that will host the catalog images -* `ESHOP_AZURE_STORAGE_MARKETING` with the URL of the Azure Storage that will host the marketing campaign images - -You might wonder why an external image resource (storage) is needed when using `docker-compose.prod.yml` instead of `docker-compose.override.yml`. Answer to this is related to a limitation of Docker Compose file format. This is how we set the environment configuration of Catalog microservice in `docker-compose.override.yml`: - -``` -PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG:-http://localhost:5101/api/v1/catalog/items/[0]/pic/} -``` - -The `PicBaseUrl` variable is set to the value of `ESHOP_AZURE_STORAGE_CATALOG` if this variable is set to any value other than blank string. If not, the value is set to `http://localhost:5101/api/v1/catalog/items/[0]/pic/`. That works perfectly in a local environment where you run all your services in `localhost` and setting `ESHOP_AZURE_STORAGE_CATALOG` you can use or not Azure Storage for the images (if you don't use Azure Storage images are served locally by catalog servide). But when you run the services in a external docker host, specified in `ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP`, the configuration should be as follows: - -``` -PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG:-http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101/api/v1/catalog/items/[0]/pic/} -``` - -So, use `ESHOP_AZURE_STORAGE_CATALOG` if set, and if not use `http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101/api/v1/catalog/items/[0]/pic/}`. Unfortunately seems that docker-compose do not substitute variables inside variables, so the value that `PicBaseUrl` gets if `ESHOP_AZURE_STORAGE_CATALOG` is not set is literally `http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101/api/v1/catalog/items/[0]/pic/}` without any substitution. - -## Build container (DEPRECATED) - -NOTE that since we support Docker MULTI-STAGE builds (support in VS 2017 since December 2017), the build container is no loger needed in CI/CD pipelines as a similar process is done by Docker itself under the covers with the multi-stage builds. -For more info on Docker Multi-Stage, read: - -https://docs.docker.com/develop/develop-images/multistage-build/ - -https://blogs.msdn.microsoft.com/stevelasker/2017/09/11/net-and-multistage-dockerfiles/ - -* `docker-compose.ci.build.yml`: This file is for starting the build container to build the project using a container that has all needed prerequisites. Refer to [corresponding wiki section](https://github.com/dotnet-architecture/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)#build-the-bits-through-the-build-container-image) for more information. - -**For more information** about docker-compose variable substitution read the [compose docs](https://docs.docker.com/compose/compose-file/#variable-substitution). - -## Other files - -* `docker-compose.nobuild.yml`: This file contains the definition of all images needed to run the eShopOnContainers. Contains **the same images that `docker-compose.yml`** but without any `build` instruction. If you use this file instead of `docker-compose.yml` when launching the project and you don't have the images built locally, **the images will be pulled from dockerhub**. This file is not intended for development usage, but for some CI/CD scenarios. -* `docker-compose.vs.debug.yml`: This file is used by Docker Tools of VS2017, and should not be used directly. -* `docker-compose.vs.release.yml`: This file is used by Docker Tools of VS2017, and should not be used directly. - -**Note**: The reason why we need the `docker-compose.nobuild.yml` is that [docker-compose issue #3391](https://github.com/docker/compose/issues/3391). Once solved, parameter `--no-build` of docker-compose could be used safely in a CI/CD environments and the need for this file will disappear. - - -## Windows container files - -All `docker-compose-windows*.yml` files have a 1:1 relationship with the same file without the `-windows` in its name. Those files are used to run Windows Containers instead of Linux Containers. - -* `docker-compose-windows.yml`: Contains the definitions of all containers that are needed to run eShopOnContainers using windows containers (equivalent to `docker-compose.yml`). -* `docker-compose-windows.override.yml`: Contains the base configuration for all windows containers - -**Note** We plan **to remove** the `docker-compose-windows.override.yml` file, because it is **exactly the same** as the `docker-compose.override.yml`. The reason of its existence is historical, but is no longer needed. You can use `docker-compose.override.yml` instead. - -* `docker-compose-windows.prod.yml` is the equivalent of `docker-compose.prod.yml` for containers windows. As happens with `docker-compose-windows.override.yml` this file will be deleted in a near future, so you should use `docker-compose.prod.yml` instead. - -## "External container" files - -These files were intended to provide a fast way to start only "infrastructure" containers (SQL Server, Redis, etc). *This files are deprecated and will be deleted in a near future**: - -* `docker-compose-external.override.yml` -* `docker-compose-external.yml` - -If you want to start only certain containers use `docker-compose -f ... -f ... up container1 contaner2 containerN` as specified in [compose doc](https://docs.docker.com/compose/reference/up/) diff --git a/obsolete/readme/readme.md b/obsolete/readme/readme.md deleted file mode 100644 index 3515f165f9..0000000000 --- a/obsolete/readme/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# Documentation index - -This file contains links to the documentation of the project. - -* **Wiki**: The wiki contains detailed step-by-step information about how to set up the project. Read it at: [https://github.com/dotnet-architecture/eShopOnContainers/wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki) - -## Documentation included in files - -* [Branch Guide](../branch-guide.md): List of branches used and their purpose. -* [vsts-docs folder](../vsts-docs/readme.md): Information about how to setup a CI/CD procedure using Azure DevOps -* [Kubernetes](../k8s/readme.md): Information about how to deploy eShopOnContainers in a kubernetes cluster, and how to setup a CI/CD for k8s using VSTS -* [deploy](../deploy/readme.md): Information about how deploy Azure resources using the Azure CLI 2.0. -* [.env file](./README.ENV.md): What is the `.env` file and how to use it to configure eShopOnContainers to use external resources (like Azure) -* [docker-compose files](./readme-docker-compose.md): What are all these `docker-compose-*.yml` files - -## Docs folder - -The `/docs` folder contains the pdfs versions of the books - diff --git a/obsolete/vsts-docs/builds/images/android-build-step1.png b/obsolete/vsts-docs/builds/images/android-build-step1.png deleted file mode 100644 index 9a85628006..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build-step1.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/android-build-step2.png b/obsolete/vsts-docs/builds/images/android-build-step2.png deleted file mode 100644 index 3db9db1bbc..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build-step2.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/android-build-step3.png b/obsolete/vsts-docs/builds/images/android-build-step3.png deleted file mode 100644 index e53b18862c..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build-step3.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/android-build-step4.png b/obsolete/vsts-docs/builds/images/android-build-step4.png deleted file mode 100644 index de24e50320..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build-step4.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/android-build-step5.png b/obsolete/vsts-docs/builds/images/android-build-step5.png deleted file mode 100644 index e5fdc6a5d8..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build-step5.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/android-build.png b/obsolete/vsts-docs/builds/images/android-build.png deleted file mode 100644 index 8e428c3d45..0000000000 Binary files a/obsolete/vsts-docs/builds/images/android-build.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/ios-build-step1.png b/obsolete/vsts-docs/builds/images/ios-build-step1.png deleted file mode 100644 index 8f1a1e1ace..0000000000 Binary files a/obsolete/vsts-docs/builds/images/ios-build-step1.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/ios-build-step2.png b/obsolete/vsts-docs/builds/images/ios-build-step2.png deleted file mode 100644 index ce32484370..0000000000 Binary files a/obsolete/vsts-docs/builds/images/ios-build-step2.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/ios-build-step3.png b/obsolete/vsts-docs/builds/images/ios-build-step3.png deleted file mode 100644 index a6e7e81767..0000000000 Binary files a/obsolete/vsts-docs/builds/images/ios-build-step3.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/images/ios-build.png b/obsolete/vsts-docs/builds/images/ios-build.png deleted file mode 100644 index 4595f40604..0000000000 Binary files a/obsolete/vsts-docs/builds/images/ios-build.png and /dev/null differ diff --git a/obsolete/vsts-docs/builds/xamarin-android.md b/obsolete/vsts-docs/builds/xamarin-android.md deleted file mode 100644 index 1459f151eb..0000000000 --- a/obsolete/vsts-docs/builds/xamarin-android.md +++ /dev/null @@ -1,95 +0,0 @@ -# Xamarin Android Build - -Follow these steps to create a VSTS build for your eShopOnContainers app (android). - -**Note**: This document assumes basic knowledge about creating builds and configuring external VSTS connections - -## Creating the build - -Despite the _"Get Sources"_ task there are five tasks more in the build: - -1. Restore NuGet Packages -2. Build Xamarin Android Project -3. Download the certstore to sign the APK -4. Sign the APK -5. Publish the build artifact. - -![Android Build Steps](images/android-build.png) - -Let's discuss each of them. - -### Restore NuGet Packages - -Add a "NuGet restore" task and enter the following configuration: - -1. Enter `eShopOnContainers-Android.sln` in "Path to solution, packages.config, or project.json". This sln is created ex professo for the build and contains only the Xamarin Android project plus the Xamarin Forms one. - -![Android Build Step 1](images/android-build-step1.png) - -### Build the project - -Add a "Xamarin Android" task with following configuration: - -1. `**/*Droid*.csproj` in "Project" -2. `$(build.binariesdirectory)/$(BuildConfiguration)` in "Output Directory" -3. `$(BuildConfiguration)` in "Configuration" -4. Ensure that the "Create App Package" checkbox is enabled -5. In "JDK Options" be sure to select "JDK 8" in the "JDK Version" dropdown. - -![Android Build Step 2](images/android-build-step2.png) - -### Download the keystore to sign the build - -** Note** This require you have a valid keystore. Refer to [this Xamarin article](https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_2_-_signing_the_android_application_package/) for instructions on how create one, using Visual Studio and Xamarin. Or if you prefer, you can read [how use the Android SDK tools to create a keystore](https://developer.android.com/studio/publish/app-signing.html). - -This build assumes the keystore is stored somewhere in internet. Beware on where you store your keystores! Keem them safe and privately. Always consider other possible alternatives on where store the keycert: - -1. Store in the source control repository, **assuming it's private**. For public repositories this option is discarded -2. Store in the build agent. If you use a custom VSTS build agent, store the keycert files locally in the agent. This is simple and secure. -3. Store in internet. If this is the case, **protect the resource**. You can be forced to use this option if your repository is public *and* you use the VSTS hosted agent. - -Add a task "Download file" (**Note:** this task is installed [through a VSTS extension](https://marketplace.visualstudio.com/items?itemName=automagically.DownloadFile)) with following configuration: - -1. `$(keystore.url)$(keystore.name)` in "File URL" -2. `$(Build.SourcesDirectory)` in "Destination Folder" - -Fill the "Credentials" section accordly. - -![Android Build Step 3](images/android-build-step3.png) - -**Note:** You can, of course, use any other way to download the file (like a Powershell task). - -### Signing the APK - -Add a "Android Signing" task with following configuation: - -1. `$(build.binariesdirectory)/$(BuildConfiguration)/*.apk` in "APK Files" -2. Ensure the checkbox "Sign the APK" is checked -3. `$(Build.SourcesDirectory)\$(keystore.name)` in "Keystore file". This location has to be where the keystore is. If you downloaded it using a previous task (as our example), use the same value. If keystore is physically in the VSTS agent you can use the filepath. -4. `$(keystore.pwd)` in "Keystore Password" -5. `$(keystore.alias)` in "Keystore Alias" -6. `$(key.pwd)` in "Key password". -7. `-verbose` in "Jarsigner Arguments" -7. Ensure the checkbox "Zipalign" is checked. - -![Android Build Step 4](images/android-build-step4.png) - -### Publishing build artifact - -Add a "Publish Build Artifacts" task, with following configuration: - -1. `$(build.binariesdirectory)/$(BuildConfiguration)` in "Path to publish" -2. `drop` in "Artifact Name" -3. `Server` in "Artifact Type" - -![Android Build Step 5](images/android-build-step5.png) - -## Variables - -You need to setup the following variables: - -1. `keystore.pwd` -> Password of the keystore -2. `keystore.alias` -> Alias of the keystore -3. `keystore.url` -> Full URL of the keystore -4. `key.pwd` -> Password of the key - diff --git a/obsolete/vsts-docs/builds/xamarin-iOS.md b/obsolete/vsts-docs/builds/xamarin-iOS.md deleted file mode 100644 index a47a880f37..0000000000 --- a/obsolete/vsts-docs/builds/xamarin-iOS.md +++ /dev/null @@ -1,63 +0,0 @@ -# Xamarin iOS Build - -Follow these steps to create a VSTS build for your eShopOnContainers app (iOS) - -**Note**: This document assumes basic knowledge about creating builds and configuring external VSTS connections - -## Creating the build - -Despite the _"Get Sources"_ task there are three tasks more in the build: - -1. Build Xamarin iOS Project -2. Copy generated packages -3. Publish the build artifact. - -![iOS Build Steps](images/ios-build.png) - -Let's discuss each of them. - -### Build the project - -Add a "Xamarin iOS" task with following configuration: - -1. `eShopOnContainers-iOS.sln` in "Solution". This solution has been created ex professo for the build. -2. Ensure that the "Create App Package" checkbox is enabled - -**About signing & Provisioning section** - -In order to deploy your app to a physical device you must sign it using a certificate with a provisioning profile. Refer to [this blog -post of the Xamarin team](https://blog.xamarin.com/continuous-integration-for-ios-apps-with-visual-studio-team-services/) for more info. - -Basically you have three options for setting the certificate (p12 file) and the provisioning profile: - -1. Use MacInCloud VSTS agent and setup the p12 file and provisioning profile in the setup [https://blogs.msdn.microsoft.com/visualstudioalm/2015/11/18/macincloud-visual-studio-team-services-build-and-improvements-to-ios-build-support/](https://blogs.msdn.microsoft.com/visualstudioalm/2015/11/18/macincloud-visual-studio-team-services-build-and-improvements-to-ios-build-support/) -2. Use a custom mac machine with the certificate and provisioning profile installed. In this case you don't have to do anything else. -3. Have the p12 file and the provisioning profile reachable on somewhere - -If you choose option 3, you need to download the certificate and the provisioning profile into the build agent (using a previous build task). -Once downloaded two files, you have to specify the location of both in the "Signing & Provisioning Section". - -![iOS Build Step 1](images/ios-build-step1.png) - -### Copy generated files to output folder - -Add a "Copy files" task with following configuration: - -1. `src/Mobile/eShopOnContainers/eShopOnContainers.iOS/bin/iPhone/$(BuildConfiguration)` in "Source Folder" -2. `**/*.ipa` in "Contents" -3. `$(Build.ArtifactStagingDirectory)` in "Target Folder" -4. Ensure that "Clean Target folder" (under "Advanced" section) is checked - -This way we copy the generated IPA in the _Build.ArtifactStagingDirectory_ folder (and remove any previous IPA generated by a previous build). - -![iOS Build Step 2](images/ios-build-step2.png) - -### Publishing build artifact - -Add a "Publish Build Artifacts" task, with following configuration: - -1. `$(Build.ArtifactStagingDirectory)` in "Path to publish" -2. `drop` in "Artifact Name" -3. `Server` in "Artifact Type" - -![Android Build Step 3](images/ios-build-step3.png) diff --git a/obsolete/vsts-docs/readme.md b/obsolete/vsts-docs/readme.md deleted file mode 100644 index f288516566..0000000000 --- a/obsolete/vsts-docs/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# VSTS Related Documentation - -## Builds and releases - -1. [VSTS build for Xamarin App (Android)](builds/xamarin-android.md) -2. [VSTS build for Xamarin App (iOS)](builds/xamarin-iOS.md) - diff --git a/src/.dockerignore b/src/.dockerignore index 2cec0e7b04..dc9d4af2ca 100644 --- a/src/.dockerignore +++ b/src/.dockerignore @@ -20,5 +20,4 @@ Web/WebSPA/wwwroot/ packages/ test-results/ TestResults/ -Mobile/ -Services/Marketing/Infrastructure/ \ No newline at end of file +Mobile/ \ No newline at end of file diff --git a/src/.env b/src/.env index 96b8016507..3aac89a3f4 100644 --- a/src/.env +++ b/src/.env @@ -7,21 +7,17 @@ # Use this values to run the app locally in Windows ESHOP_EXTERNAL_DNS_NAME_OR_IP=host.docker.internal ESHOP_STORAGE_CATALOG_URL=http://host.docker.internal:5202/c/api/v1/catalog/items/[0]/pic/ -ESHOP_STORAGE_MARKETING_URL=http://host.docker.internal:5110/api/v1/campaigns/[0]/pic/ # Use this values to run the app locally in Mac # ESHOP_EXTERNAL_DNS_NAME_OR_IP=docker.for.mac.localhost # ESHOP_STORAGE_CATALOG_URL=http://docker.for.mac.localhost:5202/c/api/v1/catalog/items/[0]/pic/ -# ESHOP_STORAGE_MARKETING_URL=http://docker.for.mac.localhost:5110/api/v1/campaigns/[0]/pic/ # Use this values to run the app locally in Linux # ESHOP_EXTERNAL_DNS_NAME_OR_IP=docker.for.linux.localhost # ESHOP_STORAGE_CATALOG_URL=http://docker.for.linux.localhost:5202/c/api/v1/catalog/items/[0]/pic/ -# ESHOP_STORAGE_MARKETING_URL=http://docker.for.linux.localhost:5110/api/v1/campaigns/[0]/pic/ # Configure this values to the cloud storage locations # ESHOP_STORAGE_CATALOG_URL= -# ESHOP_STORAGE_MARKETING_URL= ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.162 @@ -31,13 +27,9 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.162 #ESHOP_AZURE_CATALOG_DB= #ESHOP_AZURE_IDENTITY_DB= #ESHOP_AZURE_ORDERING_DB= -#ESHOP_AZURE_MARKETING_DB= #ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI= #ESHOP_AZURE_STORAGE_CATALOG_NAME= #ESHOP_AZURE_STORAGE_CATALOG_KEY= -#ESHOP_AZURE_STORAGE_MARKETING_NAME= -#ESHOP_AZURE_STORAGE_MARKETING_KEY= #ESHOP_SERVICE_BUS_USERNAME= #ESHOP_SERVICE_BUS_PASSWORD= -#INSTRUMENTATION_KEY= -#USE_LOADTEST= \ No newline at end of file +#INSTRUMENTATION_KEY= \ No newline at end of file diff --git a/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml b/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml deleted file mode 100644 index 54b1afa060..0000000000 --- a/src/ApiGateways/Envoy/config/mobilemarketing/envoy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: logical_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml b/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml deleted file mode 100644 index 11ef504da6..0000000000 --- a/src/ApiGateways/Envoy/config/webmarketing/envoy.yaml +++ /dev/null @@ -1,88 +0,0 @@ -admin: - access_log_path: "/dev/null" - address: - socket_address: - address: 0.0.0.0 - port_value: 8001 -static_resources: - listeners: - - address: - socket_address: - address: 0.0.0.0 - port_value: 80 - filter_chains: - - filters: - - name: envoy.http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - name: eshop_backend_route - virtual_hosts: - - name: eshop_backend - domains: - - "*" - routes: - - name: "m-short" - match: - prefix: "/m/" - route: - auto_host_rewrite: true - prefix_rewrite: "/marketing-api/" - cluster: marketing - - name: "m-long" - match: - prefix: "/marketing-api/" - route: - auto_host_rewrite: true - cluster: marketing - - name: "l-short" - match: - prefix: "/l/" - route: - auto_host_rewrite: true - prefix_rewrite: "/locations-api/" - cluster: locations - - name: "l-long" - match: - prefix: "/locations-api/" - route: - auto_host_rewrite: true - cluster: locations - http_filters: - - name: envoy.router - access_log: - - name: envoy.file_access_log - filter: - not_health_check_filter: {} - config: - json_format: - time: "%START_TIME%" - protocol: "%PROTOCOL%" - duration: "%DURATION%" - request_method: "%REQ(:METHOD)%" - request_host: "%REQ(HOST)%" - path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" - response_flags: "%RESPONSE_FLAGS%" - route_name: "%ROUTE_NAME%" - upstream_host: "%UPSTREAM_HOST%" - upstream_cluster: "%UPSTREAM_CLUSTER%" - upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" - path: "/tmp/access.log" - clusters: - - name: marketing - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: marketing-api - port_value: 80 - - name: locations - connect_timeout: 0.25s - type: strict_dns - lb_policy: round_robin - hosts: - - socket_address: - address: locations-api - port_value: 80 diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile index 5f36895de1..ee03709100 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build WORKDIR /src # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles @@ -24,10 +24,6 @@ COPY "Services/Catalog/Catalog.API/Catalog.API.csproj" "Services/Catalog/Catalog COPY "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" COPY "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" COPY "Services/Identity/Identity.API/Identity.API.csproj" "Services/Identity/Identity.API/Identity.API.csproj" -COPY "Services/Location/Locations.API/Locations.API.csproj" "Services/Location/Locations.API/Locations.API.csproj" -COPY "Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj" "Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj" -COPY "Services/Marketing/Marketing.API/Marketing.API.csproj" "Services/Marketing/Marketing.API/Marketing.API.csproj" -COPY "Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj" "Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj" COPY "Services/Ordering/Ordering.API/Ordering.API.csproj" "Services/Ordering/Ordering.API/Ordering.API.csproj" COPY "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" COPY "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index 4cfe352f00..b2a61dc7dd 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster +FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -7,10 +7,11 @@ EXPOSE 80 WORKDIR /src COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] +COPY ["src/NuGet.config", "src/NuGet.config"] RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" -RUN dotnet build --no-restore -c $BUILD_CONFIGURATION +RUN dotnet build -c $BUILD_CONFIGURATION CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs new file mode 100644 index 0000000000..e74a4b2f50 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs @@ -0,0 +1,41 @@ +using Grpc.Core; +using Grpc.Core.Interceptors; +using Microsoft.Extensions.Logging; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Infrastructure +{ + public class GrpcExceptionInterceptor : Interceptor + { + private readonly ILogger _logger; + + public GrpcExceptionInterceptor(ILogger logger) + { + _logger = logger; + } + + public override AsyncUnaryCall AsyncUnaryCall( + TRequest request, + ClientInterceptorContext context, + AsyncUnaryCallContinuation continuation) + { + var call = continuation(request, context); + + return new AsyncUnaryCall(HandleResponse(call.ResponseAsync), call.ResponseHeadersAsync, call.GetStatus, call.GetTrailers, call.Dispose); + } + + private async Task HandleResponse(Task t) + { + try + { + var response = await t; + return response; + } + catch (RpcException e) + { + _logger.LogError("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); + return default; + } + } + } +} diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj index 770d084c3a..4a982fc2de 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 Mobile.Shopping.HttpAggregator Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator ..\..\..\docker-compose.dcproj @@ -15,19 +15,20 @@ - - - - - - - + + + + + + + + - - - + + + - + diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs index 44749ff6cb..3ecddcf361 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs @@ -42,7 +42,7 @@ public class OrderData public string Buyer { get; set; } - public List OrderItems { get; } = new List(); + public List OrderItems { get; } = new List(); } } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs index c5a6ccb3ef..066f01a9cf 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs @@ -5,7 +5,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models public class UpdateBasketItemsRequest { - + public string BasketId { get; set; } public ICollection Updates { get; set; } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs index a1c2555519..f8fb7eb03b 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs @@ -2,7 +2,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models { - + public class UpdateBasketRequest { public string BuyerId { get; set; } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs index 2fc86c51fe..3e80a543f7 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs @@ -1,55 +1,29 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; +using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator; using Serilog; -using System.IO; -namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator -{ - public class Program - { - private static IConfiguration _configuration; - public static void Main(string[] args) +BuildWebHost(args).Run(); +IWebHost BuildWebHost(string[] args) => + WebHost + .CreateDefaultBuilder(args) + .ConfigureAppConfiguration(cb => { - _configuration = GetConfiguration(); - - BuildWebHost(args).Run(); - } - - public static IWebHost BuildWebHost(string[] args) => - WebHost - .CreateDefaultBuilder(args) - .ConfigureAppConfiguration(cb => - { - var sources = cb.Sources; - sources.Insert(3, new Microsoft.Extensions.Configuration.Json.JsonConfigurationSource() - { - Optional = true, - Path = "appsettings.localhost.json", - ReloadOnChange = false - }); - }) - .UseStartup() - .UseSerilog((builderContext, config) => - { - config - .MinimumLevel.Information() - .Enrich.FromLogContext() - .WriteTo.Console(); - }) - .Build(); - - private static IConfiguration GetConfiguration() + var sources = cb.Sources; + sources.Insert(3, new Microsoft.Extensions.Configuration.Json.JsonConfigurationSource() + { + Optional = true, + Path = "appsettings.localhost.json", + ReloadOnChange = false + }); + }) + .UseStartup() + .UseSerilog((builderContext, config) => { - var builder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddEnvironmentVariables(); - - var config = builder.Build(); - - return builder.Build(); - } - } -} + config + .MinimumLevel.Information() + .Enrich.FromLogContext() + .WriteTo.Console(); + }) + .Build(); \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs index 8bd4c8948e..d6217175bd 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs @@ -1,54 +1,38 @@ -using Grpc.Net.Client; -using GrpcBasket; -using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; +using GrpcBasket; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services { public class BasketService : IBasketService { - private readonly HttpClient _httpClient; - private readonly UrlsConfig _urls; + private readonly Basket.BasketClient _basketClient; private readonly ILogger _logger; - public BasketService(HttpClient httpClient, IOptions config, ILogger logger) + public BasketService(Basket.BasketClient basketClient, ILogger logger) { - _httpClient = httpClient; - _urls = config.Value; + _basketClient = basketClient; _logger = logger; } public async Task GetById(string id) { - return await GrpcCallerService.CallService(_urls.GrpcBasket, async channel => - { - - var client = new Basket.BasketClient(channel); - _logger.LogDebug("grpc client created, request = {@id}", id); - var response = await client.GetBasketByIdAsync(new BasketRequest { Id = id }); - _logger.LogDebug("grpc response {@response}", response); + _logger.LogDebug("grpc client created, request = {@id}", id); + var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id }); + _logger.LogDebug("grpc response {@response}", response); - return MapToBasketData(response); - }); + return MapToBasketData(response); } public async Task UpdateAsync(BasketData currentBasket) { - await GrpcCallerService.CallService(_urls.GrpcBasket, async httpClient => - { - var channel = GrpcChannel.ForAddress(_urls.GrpcBasket); - var client = new Basket.BasketClient(channel); - _logger.LogDebug("Grpc update basket currentBasket {@currentBasket}", currentBasket); - var request = MapToCustomerBasketRequest(currentBasket); - _logger.LogDebug("Grpc update basket request {@request}", request); + _logger.LogDebug("Grpc update basket currentBasket {@currentBasket}", currentBasket); + var request = MapToCustomerBasketRequest(currentBasket); + _logger.LogDebug("Grpc update basket request {@request}", request); - return await client.UpdateBasketAsync(request); - }); + await _basketClient.UpdateBasketAsync(request); } private BasketData MapToBasketData(CustomerBasketResponse customerBasketRequest) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs index f98b909895..0101a70588 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs @@ -1,48 +1,32 @@ using CatalogApi; -using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; -using Microsoft.Extensions.Options; using System.Collections.Generic; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; -using static CatalogApi.Catalog; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services { public class CatalogService : ICatalogService { - private readonly HttpClient _httpClient; - private readonly UrlsConfig _urls; + private readonly Catalog.CatalogClient _client; - public CatalogService(HttpClient httpClient, IOptions config) + public CatalogService(Catalog.CatalogClient client) { - _httpClient = httpClient; - _urls = config.Value; + _client = client; } public async Task GetCatalogItemAsync(int id) { - - return await GrpcCallerService.CallService(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemById(id), async channel => - { - var client = new CatalogClient(channel); - var request = new CatalogItemRequest { Id = id }; - var response = await client.GetItemByIdAsync(request); - return MapToCatalogItemResponse(response); - }); + var request = new CatalogItemRequest { Id = id }; + var response = await _client.GetItemByIdAsync(request); + return MapToCatalogItemResponse(response); } public async Task> GetCatalogItemsAsync(IEnumerable ids) { - - return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel=> - { - var client = new CatalogClient(channel); - var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 }; - var response = await client.GetItemsByIdsAsync(request); - return response.Data.Select(this.MapToCatalogItemResponse); - }); + var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 }; + var response = await _client.GetItemsByIdsAsync(request); + return response.Data.Select(MapToCatalogItemResponse); } private CatalogItem MapToCatalogItemResponse(CatalogItemResponse catalogItemResponse) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs deleted file mode 100644 index 55f3df3ee7..0000000000 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Grpc.Core; -using Grpc.Net.Client; -using Serilog; -using System; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services -{ - public static class GrpcCallerService - { - public static async Task CallService(string urlGrpc, Func> func) - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - - var channel = GrpcChannel.ForAddress(urlGrpc); - - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - - */ - - - Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target); - - try - { - return await func(channel); - } - catch (RpcException e) - { - Log.Error("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); - return default; - } - finally - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", false); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", false); - } - } - - public static async Task CallService(string urlGrpc, Func func) - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - */ - - var channel = GrpcChannel.ForAddress(urlGrpc); - - Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target); - - try - { - await func(channel); - } - catch (RpcException e) - { - Log.Error("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); - } - finally - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", false); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", false); - } - } - } -} diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs index d34a5338ae..7f9d5deb78 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs @@ -1,41 +1,31 @@ using GrpcOrdering; -using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services { public class OrderingService : IOrderingService { - private readonly HttpClient _httpClient; - private readonly UrlsConfig _urls; + private readonly OrderingGrpc.OrderingGrpcClient _orderingGrpcClient; private readonly ILogger _logger; - public OrderingService(HttpClient httpClient, IOptions config, ILogger logger) + public OrderingService(OrderingGrpc.OrderingGrpcClient orderingGrpcClient, ILogger logger) { - _httpClient = httpClient; - _urls = config.Value; + _orderingGrpcClient = orderingGrpcClient; _logger = logger; } public async Task GetOrderDraftAsync(BasketData basketData) { + _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData); - return await GrpcCallerService.CallService(_urls.GrpcOrdering, async channel => - { - var client = new OrderingGrpc.OrderingGrpcClient(channel); - _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData); - - var command = MapToOrderDraftCommand(basketData); - var response = await client.CreateOrderDraftFromBasketDataAsync(command); - _logger.LogDebug(" grpc response: {@response}", response); + var command = MapToOrderDraftCommand(basketData); + var response = await _orderingGrpcClient.CreateOrderDraftFromBasketDataAsync(command); + _logger.LogDebug(" grpc response: {@response}", response); - return MapToResponse(response, basketData); - }); + return MapToResponse(response, basketData); } private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index 6523cafe98..3e1ec38870 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -1,4 +1,7 @@ -using Devspaces.Support; +using CatalogApi; +using Devspaces.Support; +using GrpcBasket; +using GrpcOrdering; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; @@ -14,6 +17,7 @@ using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using System; using System.Collections.Generic; @@ -39,14 +43,13 @@ public void ConfigureServices(IServiceCollection services) .AddUrlGroup(new Uri(Configuration["OrderingUrlHC"]), name: "orderingapi-check", tags: new string[] { "orderingapi" }) .AddUrlGroup(new Uri(Configuration["BasketUrlHC"]), name: "basketapi-check", tags: new string[] { "basketapi" }) .AddUrlGroup(new Uri(Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }) - .AddUrlGroup(new Uri(Configuration["MarketingUrlHC"]), name: "marketingapi-check", tags: new string[] { "marketingapi" }) - .AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }) - .AddUrlGroup(new Uri(Configuration["LocationUrlHC"]), name: "locationapi-check", tags: new string[] { "locationapi" }); + .AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }); services.AddCustomMvc(Configuration) .AddCustomAuthentication(Configuration) .AddDevspaces() - .AddHttpServices(); + .AddHttpServices() + .AddGrpcServices(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -177,19 +180,40 @@ public static IServiceCollection AddHttpServices(this IServiceCollection service services.AddSingleton(); //register http services - services - .AddHttpClient() - .AddHttpMessageHandler() - .AddDevspacesSupport(); - - services.AddHttpClient() - .AddDevspacesSupport(); services.AddHttpClient() .AddDevspacesSupport(); - services.AddHttpClient() - .AddDevspacesSupport(); + return services; + } + + public static IServiceCollection AddGrpcServices(this IServiceCollection services) + { + services.AddTransient(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var basketApi = services.GetRequiredService>().Value.GrpcBasket; + options.Address = new Uri(basketApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var catalogApi = services.GetRequiredService>().Value.GrpcCatalog; + options.Address = new Uri(catalogApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var orderingApi = services.GetRequiredService>().Value.GrpcOrdering; + options.Address = new Uri(orderingApi); + }).AddInterceptor(); return services; } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs index b16530e1bc..b19874aac8 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs @@ -20,7 +20,7 @@ public class CatalogOperations public class BasketOperations { public static string GetItemById(string id) => $"/api/v1/basket/{id}"; - + public static string UpdateBasket() => "/api/v1/basket"; } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile index 037105cb40..5736c19f72 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base +FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build +FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build WORKDIR /src # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles @@ -24,10 +24,6 @@ COPY "Services/Catalog/Catalog.API/Catalog.API.csproj" "Services/Catalog/Catalog COPY "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" "Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj" COPY "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" "Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj" COPY "Services/Identity/Identity.API/Identity.API.csproj" "Services/Identity/Identity.API/Identity.API.csproj" -COPY "Services/Location/Locations.API/Locations.API.csproj" "Services/Location/Locations.API/Locations.API.csproj" -COPY "Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj" "Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj" -COPY "Services/Marketing/Marketing.API/Marketing.API.csproj" "Services/Marketing/Marketing.API/Marketing.API.csproj" -COPY "Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj" "Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj" COPY "Services/Ordering/Ordering.API/Ordering.API.csproj" "Services/Ordering/Ordering.API/Ordering.API.csproj" COPY "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" "Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj" COPY "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" "Services/Ordering/Ordering.Domain/Ordering.Domain.csproj" diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop index 79f5317774..462afbcd99 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster +FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim ARG BUILD_CONFIGURATION=Debug ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=true @@ -7,10 +7,11 @@ EXPOSE 80 WORKDIR /src COPY ["src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj", "src/ApiGateways/Web.Bff.Shopping/aggregator/"] COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"] +COPY ["src/NuGet.config", "src/NuGet.config"] RUN dotnet restore src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/ApiGateways/Web.Bff.Shopping/aggregator" -RUN dotnet build --no-restore -c $BUILD_CONFIGURATION +RUN dotnet build -c $BUILD_CONFIGURATION CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]] \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs new file mode 100644 index 0000000000..dc6b7e6f8d --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Infrastructure/GrpcExceptionInterceptor.cs @@ -0,0 +1,41 @@ +using Grpc.Core; +using Grpc.Core.Interceptors; +using Microsoft.Extensions.Logging; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure +{ + public class GrpcExceptionInterceptor : Interceptor + { + private readonly ILogger _logger; + + public GrpcExceptionInterceptor(ILogger logger) + { + _logger = logger; + } + + public override AsyncUnaryCall AsyncUnaryCall( + TRequest request, + ClientInterceptorContext context, + AsyncUnaryCallContinuation continuation) + { + var call = continuation(request, context); + + return new AsyncUnaryCall(HandleResponse(call.ResponseAsync), call.ResponseHeadersAsync, call.GetStatus, call.GetTrailers, call.Dispose); + } + + private async Task HandleResponse(Task t) + { + try + { + var response = await t; + return response; + } + catch (RpcException e) + { + _logger.LogError("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); + return default; + } + } + } +} diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs index b601d67f29..083292f549 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs @@ -1,38 +1,29 @@ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; +using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator; using Serilog; -namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHost(args).Run(); - } - - public static IWebHost BuildWebHost(string[] args) => - WebHost - .CreateDefaultBuilder(args) - .ConfigureAppConfiguration(cb => - { - var sources = cb.Sources; - sources.Insert(3, new Microsoft.Extensions.Configuration.Json.JsonConfigurationSource() - { - Optional = true, - Path = "appsettings.localhost.json", - ReloadOnChange = false - }); - }) - .UseStartup() - .UseSerilog((builderContext, config) => - { - config - .MinimumLevel.Information() - .Enrich.FromLogContext() - .WriteTo.Console(); - }) - .Build(); +BuildWebHost(args).Run(); - } -} +IWebHost BuildWebHost(string[] args) => + WebHost + .CreateDefaultBuilder(args) + .ConfigureAppConfiguration(cb => + { + var sources = cb.Sources; + sources.Insert(3, new Microsoft.Extensions.Configuration.Json.JsonConfigurationSource() + { + Optional = true, + Path = "appsettings.localhost.json", + ReloadOnChange = false + }); + }) + .UseStartup() + .UseSerilog((builderContext, config) => + { + config + .MinimumLevel.Information() + .Enrich.FromLogContext() + .WriteTo.Console(); + }) + .Build(); \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs index 7e85132cdf..648a386c8f 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs @@ -1,52 +1,39 @@ using GrpcBasket; -using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services { public class BasketService : IBasketService { - private readonly UrlsConfig _urls; - public readonly HttpClient _httpClient; + private readonly Basket.BasketClient _basketClient; private readonly ILogger _logger; - public BasketService(HttpClient httpClient, IOptions config, ILogger logger) + public BasketService(Basket.BasketClient basketClient, ILogger logger) { - _urls = config.Value; - _httpClient = httpClient; + _basketClient = basketClient; _logger = logger; } public async Task GetById(string id) { - return await GrpcCallerService.CallService(_urls.GrpcBasket, async channel => - { - var client = new Basket.BasketClient(channel); - _logger.LogDebug("grpc client created, request = {@id}", id); - var response = await client.GetBasketByIdAsync(new BasketRequest { Id = id }); - _logger.LogDebug("grpc response {@response}", response); + _logger.LogDebug("grpc client created, request = {@id}", id); + var response = await _basketClient.GetBasketByIdAsync(new BasketRequest { Id = id }); + _logger.LogDebug("grpc response {@response}", response); - return MapToBasketData(response); - }); + return MapToBasketData(response); } public async Task UpdateAsync(BasketData currentBasket) { - await GrpcCallerService.CallService(_urls.GrpcBasket, async channel => - { - var client = new Basket.BasketClient(channel); - _logger.LogDebug("Grpc update basket currentBasket {@currentBasket}", currentBasket); - var request = MapToCustomerBasketRequest(currentBasket); - _logger.LogDebug("Grpc update basket request {@request}", request); + _logger.LogDebug("Grpc update basket currentBasket {@currentBasket}", currentBasket); + var request = MapToCustomerBasketRequest(currentBasket); + _logger.LogDebug("Grpc update basket request {@request}", request); - return await client.UpdateBasketAsync(request); - }); + await _basketClient.UpdateBasketAsync(request); } private BasketData MapToBasketData(CustomerBasketResponse customerBasketRequest) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs index 059e1d046c..f925954a6b 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs @@ -1,53 +1,41 @@ using CatalogApi; -using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Collections.Generic; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; -using static CatalogApi.Catalog; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services { public class CatalogService : ICatalogService { - private readonly HttpClient _httpClient; + private readonly Catalog.CatalogClient _client; private readonly ILogger _logger; - private readonly UrlsConfig _urls; - public CatalogService(HttpClient httpClient, ILogger logger, IOptions config) + public CatalogService(Catalog.CatalogClient client, ILogger logger) { - _httpClient = httpClient; + _client = client; _logger = logger; - _urls = config.Value; } public async Task GetCatalogItemAsync(int id) { - return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel => - { - var client = new CatalogClient(channel); - var request = new CatalogItemRequest { Id = id }; - _logger.LogInformation("grpc client created, request = {@request}", request); - var response = await client.GetItemByIdAsync(request); - _logger.LogInformation("grpc response {@response}", response); - return MapToCatalogItemResponse(response); - }); + var request = new CatalogItemRequest { Id = id }; + _logger.LogInformation("grpc request {@request}", request); + var response = await _client.GetItemByIdAsync(request); + _logger.LogInformation("grpc response {@response}", response); + return MapToCatalogItemResponse(response); + } public async Task> GetCatalogItemsAsync(IEnumerable ids) { - return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel => - { - var client = new CatalogClient(channel); - var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 }; - _logger.LogInformation("grpc client created, request = {@request}", request); - var response = await client.GetItemsByIdsAsync(request); - _logger.LogInformation("grpc response {@response}", response); - return response.Data.Select(this.MapToCatalogItemResponse); - }); + var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 }; + _logger.LogInformation("grpc request {@request}", request); + var response = await _client.GetItemsByIdsAsync(request); + _logger.LogInformation("grpc response {@response}", response); + return response.Data.Select(this.MapToCatalogItemResponse); + } private CatalogItem MapToCatalogItemResponse(CatalogItemResponse catalogItemResponse) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs deleted file mode 100644 index 2039c7c4f2..0000000000 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Grpc.Core; -using Grpc.Net.Client; -using Serilog; -using System; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services -{ - public static class GrpcCallerService - { - public static async Task CallService(string urlGrpc, Func> func) - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - - var channel = GrpcChannel.ForAddress(urlGrpc); - - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - - */ - - - Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target); - - try - { - return await func(channel); - } - catch (RpcException e) - { - Log.Error("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); - return default; - } - finally - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", false); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", false); - } - - - } - - public static async Task CallService(string urlGrpc, Func func) - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - */ - - var channel = GrpcChannel.ForAddress(urlGrpc); - - Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target); - - try - { - await func(channel); - } - catch (RpcException e) - { - Log.Error("Error calling via grpc: {Status} - {Message}", e.Status, e.Message); - } - finally - { - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", false); - AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", false); - } - } - } -} diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs index b460f4864e..ab01b20f59 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs @@ -1,40 +1,31 @@ using GrpcOrdering; -using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services { public class OrderingService : IOrderingService { - private readonly UrlsConfig _urls; + private readonly OrderingGrpc.OrderingGrpcClient _orderingGrpcClient; private readonly ILogger _logger; - public readonly HttpClient _httpClient; - public OrderingService(HttpClient httpClient, IOptions config, ILogger logger) + public OrderingService(OrderingGrpc.OrderingGrpcClient orderingGrpcClient, ILogger logger) { - _urls = config.Value; - _httpClient = httpClient; + _orderingGrpcClient = orderingGrpcClient; _logger = logger; } public async Task GetOrderDraftAsync(BasketData basketData) { - return await GrpcCallerService.CallService(_urls.GrpcOrdering, async channel => - { - var client = new OrderingGrpc.OrderingGrpcClient(channel); - _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData); + _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData); - var command = MapToOrderDraftCommand(basketData); - var response = await client.CreateOrderDraftFromBasketDataAsync(command); - _logger.LogDebug(" grpc response: {@response}", response); + var command = MapToOrderDraftCommand(basketData); + var response = await _orderingGrpcClient.CreateOrderDraftFromBasketDataAsync(command); + _logger.LogDebug(" grpc response: {@response}", response); - return MapToResponse(response, basketData); - }); + return MapToResponse(response, basketData); } private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData) diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 1ea6c0f4f1..99780f66f5 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -1,4 +1,7 @@ -using Devspaces.Support; +using CatalogApi; +using Devspaces.Support; +using GrpcBasket; +using GrpcOrdering; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; @@ -14,6 +17,7 @@ using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using System; using System.Collections.Generic; @@ -39,14 +43,13 @@ public void ConfigureServices(IServiceCollection services) .AddUrlGroup(new Uri(Configuration["OrderingUrlHC"]), name: "orderingapi-check", tags: new string[] { "orderingapi" }) .AddUrlGroup(new Uri(Configuration["BasketUrlHC"]), name: "basketapi-check", tags: new string[] { "basketapi" }) .AddUrlGroup(new Uri(Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }) - .AddUrlGroup(new Uri(Configuration["MarketingUrlHC"]), name: "marketingapi-check", tags: new string[] { "marketingapi" }) - .AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }) - .AddUrlGroup(new Uri(Configuration["LocationUrlHC"]), name: "locationapi-check", tags: new string[] { "locationapi" }); + .AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }); services.AddCustomMvc(Configuration) .AddCustomAuthentication(Configuration) .AddDevspaces() - .AddApplicationServices(); + .AddApplicationServices() + .AddGrpcServices(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -63,7 +66,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF { app.UseDeveloperExceptionPage(); } - + app.UseHttpsRedirection(); app.UseSwagger().UseSwaggerUI(c => @@ -181,24 +184,42 @@ public static IServiceCollection AddApplicationServices(this IServiceCollection //register http services - services.AddHttpClient() - .AddHttpMessageHandler() - .AddDevspacesSupport(); - - services.AddHttpClient() - .AddDevspacesSupport(); - services.AddHttpClient() .AddHttpMessageHandler() .AddDevspacesSupport(); - services.AddHttpClient() - .AddHttpMessageHandler() - .AddDevspacesSupport(); - return services; } + public static IServiceCollection AddGrpcServices(this IServiceCollection services) + { + services.AddTransient(); + + services.AddScoped(); + services.AddGrpcClient((services, options) => + { + var basketApi = services.GetRequiredService>().Value.GrpcBasket; + options.Address = new Uri(basketApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var catalogApi = services.GetRequiredService>().Value.GrpcCatalog; + options.Address = new Uri(catalogApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var orderingApi = services.GetRequiredService>().Value.GrpcOrdering; + options.Address = new Uri(orderingApi); + }).AddInterceptor(); + + return services; + } } } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index 2cef24f4e6..2bae6e150d 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 Web.Shopping.HttpAggregator Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator ..\..\..\docker-compose.dcproj @@ -15,20 +15,21 @@ - - - - - - - - + + + + + + + + + - - - + + + - + diff --git a/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj b/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj index ca139c382e..2ef3532682 100644 --- a/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj +++ b/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj @@ -1,11 +1,11 @@  - netstandard2.0 + net5.0 - - + + diff --git a/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs index 0895b752ae..43dfa82f13 100644 --- a/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs +++ b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Http; -using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; diff --git a/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs index 60108301d9..00367b26cd 100644 --- a/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs +++ b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs @@ -1,7 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Text; namespace Devspaces.Support { diff --git a/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs index 0ac5c9e1b6..d196c91849 100644 --- a/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs +++ b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs @@ -1,7 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Text; namespace Devspaces.Support { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs index 55d62ade22..c26ee6a812 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs @@ -1,8 +1,4 @@ -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs index dde05e1e30..4c9758a40f 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs @@ -1,5 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs index 828aed26af..99735b8711 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs @@ -3,8 +3,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { - public interface IIntegrationEventHandler : IIntegrationEventHandler - where TIntegrationEvent: IntegrationEvent + public interface IIntegrationEventHandler : IIntegrationEventHandler + where TIntegrationEvent : IntegrationEvent { Task Handle(TIntegrationEvent @event); } diff --git a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj index 69d2c0c056..8db6db3b50 100644 --- a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj @@ -1,7 +1,7 @@  - netstandard2.1 + net5.0 Microsoft.eShopOnContainers.BuildingBlocks.EventBus diff --git a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs index ef09911fe5..201dcf6b53 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs @@ -1,9 +1,9 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events { - public class IntegrationEvent + public record IntegrationEvent { public IntegrationEvent() { @@ -19,9 +19,9 @@ public IntegrationEvent(Guid id, DateTime createDate) } [JsonProperty] - public Guid Id { get; private set; } + public Guid Id { get; private init; } [JsonProperty] - public DateTime CreationDate { get; private set; } + public DateTime CreationDate { get; private init; } } } diff --git a/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs b/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs index de5a2cb79b..775c29c3ea 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions { diff --git a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs index ea1aca61ec..a86248f019 100644 --- a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs +++ b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs @@ -1,8 +1,8 @@ -using System; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus { diff --git a/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs b/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs index a20b3031c3..9e61034a04 100644 --- a/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs +++ b/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs @@ -7,7 +7,7 @@ public partial class InMemoryEventBusSubscriptionsManager : IEventBusSubscriptio public class SubscriptionInfo { public bool IsDynamic { get; } - public Type HandlerType{ get; } + public Type HandlerType { get; } private SubscriptionInfo(bool isDynamic, Type handlerType) { diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs index 6ee3032a80..50bd97bc90 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs @@ -203,7 +203,7 @@ private void StartBasicConsume() private async Task Consumer_Received(object sender, BasicDeliverEventArgs eventArgs) { var eventName = eventArgs.RoutingKey; - var message = Encoding.UTF8.GetString(eventArgs.Body); + var message = Encoding.UTF8.GetString(eventArgs.Body.Span); try { diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 00b95b2114..6da6eda9d6 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -1,18 +1,17 @@  - netstandard2.1 + net5.0 Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ - + - + - - - + + diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs index a3f563c2fa..0dff4154b9 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs @@ -1,32 +1,56 @@ using Microsoft.Azure.ServiceBus; -using Microsoft.Extensions.Logging; using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus { - public class DefaultServiceBusPersisterConnection :IServiceBusPersisterConnection + public class DefaultServiceBusPersisterConnection : IServiceBusPersisterConnection { - private readonly ILogger _logger; private readonly ServiceBusConnectionStringBuilder _serviceBusConnectionStringBuilder; + private readonly string _subscriptionClientName; + private SubscriptionClient _subscriptionClient; private ITopicClient _topicClient; bool _disposed; public DefaultServiceBusPersisterConnection(ServiceBusConnectionStringBuilder serviceBusConnectionStringBuilder, - ILogger logger) + string subscriptionClientName) { - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - - _serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ?? + _serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ?? throw new ArgumentNullException(nameof(serviceBusConnectionStringBuilder)); + _subscriptionClientName = subscriptionClientName; + _subscriptionClient = new SubscriptionClient(_serviceBusConnectionStringBuilder, subscriptionClientName); _topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default); } + public ITopicClient TopicClient + { + get + { + if (_topicClient.IsClosedOrClosing) + { + _topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default); + } + return _topicClient; + } + } + + public ISubscriptionClient SubscriptionClient + { + get + { + if (_subscriptionClient.IsClosedOrClosing) + { + _subscriptionClient = new SubscriptionClient(_serviceBusConnectionStringBuilder, _subscriptionClientName); + } + return _subscriptionClient; + } + } + public ServiceBusConnectionStringBuilder ServiceBusConnectionStringBuilder => _serviceBusConnectionStringBuilder; public ITopicClient CreateModel() { - if(_topicClient.IsClosedOrClosing) + if (_topicClient.IsClosedOrClosing) { _topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default); } diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 53ae33ae0f..841c303f7f 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -17,21 +17,16 @@ public class EventBusServiceBus : IEventBus private readonly IServiceBusPersisterConnection _serviceBusPersisterConnection; private readonly ILogger _logger; private readonly IEventBusSubscriptionsManager _subsManager; - private readonly SubscriptionClient _subscriptionClient; private readonly ILifetimeScope _autofac; private readonly string AUTOFAC_SCOPE_NAME = "eshop_event_bus"; private const string INTEGRATION_EVENT_SUFFIX = "IntegrationEvent"; public EventBusServiceBus(IServiceBusPersisterConnection serviceBusPersisterConnection, - ILogger logger, IEventBusSubscriptionsManager subsManager, string subscriptionClientName, - ILifetimeScope autofac) + ILogger logger, IEventBusSubscriptionsManager subsManager, ILifetimeScope autofac) { _serviceBusPersisterConnection = serviceBusPersisterConnection; _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _subsManager = subsManager ?? new InMemoryEventBusSubscriptionsManager(); - - _subscriptionClient = new SubscriptionClient(serviceBusPersisterConnection.ServiceBusConnectionStringBuilder, - subscriptionClientName); _autofac = autofac; RemoveDefaultRule(); @@ -51,9 +46,7 @@ public void Publish(IntegrationEvent @event) Label = eventName, }; - var topicClient = _serviceBusPersisterConnection.CreateModel(); - - topicClient.SendAsync(message) + _serviceBusPersisterConnection.TopicClient.SendAsync(message) .GetAwaiter() .GetResult(); } @@ -77,7 +70,7 @@ public void Subscribe() { try { - _subscriptionClient.AddRuleAsync(new RuleDescription + _serviceBusPersisterConnection.SubscriptionClient.AddRuleAsync(new RuleDescription { Filter = new CorrelationFilter { Label = eventName }, Name = eventName @@ -102,10 +95,11 @@ public void Unsubscribe() try { - _subscriptionClient - .RemoveRuleAsync(eventName) - .GetAwaiter() - .GetResult(); + _serviceBusPersisterConnection + .SubscriptionClient + .RemoveRuleAsync(eventName) + .GetAwaiter() + .GetResult(); } catch (MessagingEntityNotFoundException) { @@ -132,7 +126,7 @@ public void Dispose() private void RegisterSubscriptionClientMessageHandler() { - _subscriptionClient.RegisterMessageHandler( + _serviceBusPersisterConnection.SubscriptionClient.RegisterMessageHandler( async (message, token) => { var eventName = $"{message.Label}{INTEGRATION_EVENT_SUFFIX}"; @@ -141,7 +135,7 @@ private void RegisterSubscriptionClientMessageHandler() // Complete the message so that it is not received again. if (await ProcessEvent(eventName, messageData)) { - await _subscriptionClient.CompleteAsync(message.SystemProperties.LockToken); + await _serviceBusPersisterConnection.SubscriptionClient.CompleteAsync(message.SystemProperties.LockToken); } }, new MessageHandlerOptions(ExceptionReceivedHandler) { MaxConcurrentCalls = 10, AutoComplete = false }); @@ -194,10 +188,11 @@ private void RemoveDefaultRule() { try { - _subscriptionClient - .RemoveRuleAsync(RuleDescription.DefaultRuleName) - .GetAwaiter() - .GetResult(); + _serviceBusPersisterConnection + .SubscriptionClient + .RemoveRuleAsync(RuleDescription.DefaultRuleName) + .GetAwaiter() + .GetResult(); } catch (MessagingEntityNotFoundException) { diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 8435246a32..7bf222a59f 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -1,15 +1,15 @@  - netstandard2.1 + net5.0 Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus - - + + - + diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/IServiceBusPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/IServiceBusPersisterConnection.cs index 52737cef72..8863db62ec 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/IServiceBusPersisterConnection.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/IServiceBusPersisterConnection.cs @@ -5,8 +5,7 @@ public interface IServiceBusPersisterConnection : IDisposable { - ServiceBusConnectionStringBuilder ServiceBusConnectionStringBuilder { get; } - - ITopicClient CreateModel(); + ITopicClient TopicClient { get; } + ISubscriptionClient SubscriptionClient { get; } } } \ No newline at end of file diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs index 079cf7d7e1..731ba17e87 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF +namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { public enum EventStateEnum { diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs index de8754e03a..b517055385 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs @@ -1,13 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using System.Collections.Generic; -using System.Text; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { public class IntegrationEventLogContext : DbContext - { + { public IntegrationEventLogContext(DbContextOptions options) : base(options) { } @@ -15,7 +12,7 @@ public IntegrationEventLogContext(DbContextOptions o public DbSet IntegrationEventLogs { get; set; } protected override void OnModelCreating(ModelBuilder builder) - { + { builder.Entity(ConfigureIntegrationEventLogEntry); } diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj index bfc322c349..c9ed73500d 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj @@ -1,18 +1,18 @@  - netstandard2.1 + net5.0 Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs index f9cf4a2c1f..977dd0547a 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Newtonsoft.Json; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System.Linq; +using System; using System.ComponentModel.DataAnnotations.Schema; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; +using System.Linq; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { @@ -16,7 +11,7 @@ public class IntegrationEventLogEntry private IntegrationEventLogEntry() { } public IntegrationEventLogEntry(IntegrationEvent @event, Guid transactionId) { - EventId = @event.Id; + EventId = @event.Id; CreationTime = @event.CreationDate; EventTypeName = @event.GetType().FullName; Content = JsonConvert.SerializeObject(@event); diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs index cbf363c835..93fd111439 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs @@ -2,8 +2,6 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using System; using System.Collections.Generic; -using System.Data.Common; -using System.Linq; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs index 22c5e1fbae..12957479ba 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs @@ -1,12 +1,7 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; using System; -using System.Collections; using System.Collections.Generic; using System.Data.Common; using System.Linq; @@ -15,7 +10,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services { - public class IntegrationEventLogService : IIntegrationEventLogService,IDisposable + public class IntegrationEventLogService : IIntegrationEventLogService, IDisposable { private readonly IntegrationEventLogContext _integrationEventLogContext; private readonly DbConnection _dbConnection; @@ -43,11 +38,12 @@ public async Task> RetrieveEventLogsPendin var result = await _integrationEventLogContext.IntegrationEventLogs .Where(e => e.TransactionId == tid && e.State == EventStateEnum.NotPublished).ToListAsync(); - if(result != null && result.Any()){ + if (result != null && result.Any()) + { return result.OrderBy(o => o.CreationTime) - .Select(e => e.DeserializeJsonContent(_eventTypes.Find(t=> t.Name == e.EventTypeShortName))); + .Select(e => e.DeserializeJsonContent(_eventTypes.Find(t => t.Name == e.EventTypeShortName))); } - + return new List(); } @@ -83,7 +79,7 @@ private Task UpdateEventStatus(Guid eventId, EventStateEnum status) var eventLogEntry = _integrationEventLogContext.IntegrationEventLogs.Single(ie => ie.EventId == eventId); eventLogEntry.State = status; - if(status == EventStateEnum.InProgress) + if (status == EventStateEnum.InProgress) eventLogEntry.TimesSent++; _integrationEventLogContext.IntegrationEventLogs.Update(eventLogEntry); @@ -100,7 +96,7 @@ protected virtual void Dispose(bool disposing) _integrationEventLogContext?.Dispose(); } - + disposedValue = true; } } diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs index f8227882b9..8dbb070d39 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs @@ -1,11 +1,5 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using System; -using System.Collections.Generic; -using System.Data.Common; -using System.Text; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities @@ -16,8 +10,8 @@ public class ResilientTransaction private ResilientTransaction(DbContext context) => _context = context ?? throw new ArgumentNullException(nameof(context)); - public static ResilientTransaction New (DbContext context) => - new ResilientTransaction(context); + public static ResilientTransaction New(DbContext context) => + new ResilientTransaction(context); public async Task ExecuteAsync(Func action) { diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj index a6ccbe05e6..19aaa282f2 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj @@ -1,22 +1,26 @@  - netcoreapp3.1 + net5.0 false - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + + diff --git a/src/DockerfileSolutionRestore.txt b/src/DockerfileSolutionRestore.txt index 006f664d87..040bf761ec 100644 Binary files a/src/DockerfileSolutionRestore.txt and b/src/DockerfileSolutionRestore.txt differ diff --git a/src/Mobile/.gitignore b/src/Mobile/.gitignore deleted file mode 100644 index 8cb6c28313..0000000000 --- a/src/Mobile/.gitignore +++ /dev/null @@ -1,256 +0,0 @@ - -# Created by https://www.gitignore.io/api/visualstudio - -### VisualStudio ### -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ - -# Uncomment if you have tasks that create the project's static files in wwwroot -wwwroot/ - - - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -project.fragment.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ diff --git a/src/Mobile/AndroidSDKManager.ps1 b/src/Mobile/AndroidSDKManager.ps1 deleted file mode 100644 index 653ef74e42..0000000000 --- a/src/Mobile/AndroidSDKManager.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -$AndroidToolPath = "${env:ProgramFiles(x86)}\Android\android-sdk\tools\android.bat" -if (!(Test-Path $AndroidToolPath)) { - $AndroidToolPath = "$env:localappdata\Android\android-sdk\tools\android.bat" -} elseif (!(Test-Path $AndroidToolPath)) { - Write-Error "Unable to find Android SDK Manager tools." - return -} - -Function Get-AndroidSDKs() { - $output = & $AndroidToolPath list sdk --all - $sdks = $output |% { - if ($_ -match '(?\d+)- (?.+), revision (?[\d\.]+)') { - $sdk = New-Object PSObject - Add-Member -InputObject $sdk -MemberType NoteProperty -Name Index -Value $Matches.index - Add-Member -InputObject $sdk -MemberType NoteProperty -Name Name -Value $Matches.sdk - Add-Member -InputObject $sdk -MemberType NoteProperty -Name Revision -Value $Matches.revision - $sdk - } - } - $sdks -} - -Function Install-AndroidSDK() { - [CmdletBinding()] - Param( - [Parameter(Mandatory=$true, Position=0)] - [PSObject[]]$sdks - ) - - $sdkIndexes = $sdks |% { $_.Index } - $sdkIndexArgument = [string]::Join(',', $sdkIndexes) - Echo 'y' | & $AndroidToolPath update sdk -u -a -t $sdkIndexArgument -} - -# Example usage: -# $sdks = Get-AndroidSDKs |? { $_.name -like 'sdk platform*API 10*' -or $_.name -like 'google apis*api 10' } -# Install-AndroidSDK -sdks $sdks - -# https://github.com/AArnott \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3.info b/src/Mobile/Components/GeolocatorPlugin-1.0.3.info deleted file mode 100644 index 7595005379..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3.info +++ /dev/null @@ -1 +0,0 @@ -{"Name":"Geolocator Plugin","Id":2035,"Alias":"GeolocatorPlugin","Description":"# Geolocator Plugin details\r\n\r\nSimple cross platform plugin to get GPS location including heading, speed, and more.\r\n\r\n#### Features\r\n* Async GPS Location Detection\r\n* Heading\r\n* Speed\r\n* Listen for Changes\r\n\r\n\r\nWorks from any shared code or PCL project.\r\n\r\nFind more plugins at: http://www.github.com/xamarin/plugins","Version":"1.0.3","Summary":"Simple cross platform plugin to get GPS location including heading, speed, and more.","QuickStart":"# Getting Started with Geolocator Plugin\r\n\r\n### API Usage\r\n\r\nCall **CrossGeolocator.Current** from any project or PCL to gain access to APIs.\r\n\r\n```\r\nvar locator = CrossGeolocator.Current;\r\nlocator.DesiredAccuracy = 50;\r\n\r\nvar position = await locator.GetPositionAsync (timeoutMilliseconds: 10000);\r\n\r\nConsole.WriteLine (\"Position Status: {0}\", position.Timestamp);\r\nConsole.WriteLine (\"Position Latitude: {0}\", position.Latitude);\r\nConsole.WriteLine (\"Position Longitude: {0}\", position.Longitude);\r\n```\r\n\r\n### **IMPORTANT**\r\nAndroid:\r\n\r\nYou must request ACCESS_COARSE_LOCATION \u0026 ACCESS_FINE_LOCATION permission\r\n\r\niOS:\r\n\r\nIn iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. \r\nSee: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8\r\n\r\nWindows Phone:\r\n\r\nYou must set the ID_CAP_LOCATION permission.","Hash":"94480115a3947ef812df48cae11dbd94","TargetPlatforms":["ios","ios-unified","android"],"TrialHash":null} \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3.png deleted file mode 100644 index 3ab2b3095a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3.png +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- - -
-
-

Error

-

Oops, something unexpected happened.

-

Check out the links above and below. Maybe they can help.

-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Details.md b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Details.md deleted file mode 100644 index 1968cacaf8..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Details.md +++ /dev/null @@ -1,14 +0,0 @@ -# Geolocator Plugin details - -Simple cross platform plugin to get GPS location including heading, speed, and more. - -#### Features -* Async GPS Location Detection -* Heading -* Speed -* Listen for Changes - - -Works from any shared code or PCL project. - -Find more plugins at: http://www.github.com/xamarin/plugins \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/GettingStarted.md b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/GettingStarted.md deleted file mode 100644 index 41d19fb935..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/GettingStarted.md +++ /dev/null @@ -1,30 +0,0 @@ -# Getting Started with Geolocator Plugin - -### API Usage - -Call **CrossGeolocator.Current** from any project or PCL to gain access to APIs. - -``` -var locator = CrossGeolocator.Current; -locator.DesiredAccuracy = 50; - -var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); - -Console.WriteLine ("Position Status: {0}", position.Timestamp); -Console.WriteLine ("Position Latitude: {0}", position.Latitude); -Console.WriteLine ("Position Longitude: {0}", position.Longitude); -``` - -### **IMPORTANT** -Android: - -You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission - -iOS: - -In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. -See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8 - -Windows Phone: - -You must set the ID_CAP_LOCATION permission. \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/License.md b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/License.md deleted file mode 100644 index 38df422ffd..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/License.md +++ /dev/null @@ -1,23 +0,0 @@ -# Geolocator Plugin license - - -The MIT License (MIT) - -Copyright (c) 2014 James Montemagno / Refractored LLC - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Manifest.xml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Manifest.xml deleted file mode 100644 index ba7ed5a60d..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/Manifest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - Geolocator Plugin - James Montemagno - http://www.github.com/jamesmontemagno/Xamarin.Plugins - 1.0.3 - Simple cross platform plugin to get GPS location including heading, speed, and more. - - - - - - - - - - Android Sample - Android Sample - - - WindowsPhone Sample - WindowsPhone Sample - - - iOS Sample - iOS Sample - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_128x128.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_128x128.png deleted file mode 100644 index 1abe3c4bc5..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_128x128.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_512x512.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_512x512.png deleted file mode 100644 index 2d0eb95e02..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/component/icons/GeolocatorPlugin_512x512.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample.sln b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample.sln deleted file mode 100644 index af17e4c377..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample.sln +++ /dev/null @@ -1,210 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeolocatorSample", "GeolocatorSample\GeolocatorSample\GeolocatorSample.csproj", "{02BB8331-934C-424B-A0ED-438E6F1C39D4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeolocatorSample.iOS", "GeolocatorSample\GeolocatorSample.iOS\GeolocatorSample.iOS.csproj", "{CF64F284-8850-4DC0-ADD4-E066A0744AF3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeolocatorSample.Droid", "GeolocatorSample\GeolocatorSample.Droid\GeolocatorSample.Droid.csproj", "{FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeolocatorSample.WinPhone", "GeolocatorSample\GeolocatorSample.WinPhone\GeolocatorSample.WinPhone.csproj", "{82A2958E-AB5B-40B8-A556-DA41952F870F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Ad-Hoc|Any CPU = Ad-Hoc|Any CPU - Ad-Hoc|ARM = Ad-Hoc|ARM - Ad-Hoc|iPhone = Ad-Hoc|iPhone - Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator - Ad-Hoc|Mixed Platforms = Ad-Hoc|Mixed Platforms - Ad-Hoc|x86 = Ad-Hoc|x86 - AppStore|Any CPU = AppStore|Any CPU - AppStore|ARM = AppStore|ARM - AppStore|iPhone = AppStore|iPhone - AppStore|iPhoneSimulator = AppStore|iPhoneSimulator - AppStore|Mixed Platforms = AppStore|Mixed Platforms - AppStore|x86 = AppStore|x86 - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|iPhone = Release|iPhone - Release|iPhoneSimulator = Release|iPhoneSimulator - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|Mixed Platforms.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|Mixed Platforms.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|Any CPU.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|ARM.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.AppStore|x86.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|ARM.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Debug|x86.ActiveCfg = Debug|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|Any CPU.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|ARM.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|iPhone.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4}.Release|x86.ActiveCfg = Release|Any CPU - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|Mixed Platforms.ActiveCfg = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|Mixed Platforms.Build.0 = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|ARM.ActiveCfg = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|iPhone.Build.0 = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|Mixed Platforms.ActiveCfg = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|Mixed Platforms.Build.0 = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.AppStore|x86.ActiveCfg = AppStore|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|Any CPU.ActiveCfg = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|ARM.ActiveCfg = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|iPhone.ActiveCfg = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|iPhone.Build.0 = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|Mixed Platforms.ActiveCfg = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|Mixed Platforms.Build.0 = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Debug|x86.ActiveCfg = Debug|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|Any CPU.ActiveCfg = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|ARM.ActiveCfg = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|iPhone.ActiveCfg = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|iPhone.Build.0 = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|Mixed Platforms.ActiveCfg = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|Mixed Platforms.Build.0 = Release|iPhone - {CF64F284-8850-4DC0-ADD4-E066A0744AF3}.Release|x86.ActiveCfg = Release|iPhone - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Mixed Platforms.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Mixed Platforms.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|Mixed Platforms.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Any CPU.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|ARM.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|Mixed Platforms.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.AppStore|x86.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|ARM.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Debug|x86.ActiveCfg = Debug|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Any CPU.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Any CPU.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|ARM.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|iPhone.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|Mixed Platforms.Deploy.0 = Release|Any CPU - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748}.Release|x86.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|ARM.ActiveCfg = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|ARM.Build.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|ARM.Deploy.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Mixed Platforms.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Mixed Platforms.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|Mixed Platforms.Deploy.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|x86.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|x86.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Ad-Hoc|x86.Deploy.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Any CPU.Build.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|ARM.ActiveCfg = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|ARM.Build.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|ARM.Deploy.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Mixed Platforms.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Mixed Platforms.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|Mixed Platforms.Deploy.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|x86.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|x86.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.AppStore|x86.Deploy.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|ARM.ActiveCfg = Debug|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|ARM.Build.0 = Debug|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|ARM.Deploy.0 = Debug|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|Mixed Platforms.Deploy.0 = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|x86.ActiveCfg = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|x86.Build.0 = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Debug|x86.Deploy.0 = Debug|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Any CPU.Build.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Any CPU.Deploy.0 = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|ARM.ActiveCfg = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|ARM.Build.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|ARM.Deploy.0 = Release|ARM - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|iPhone.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Mixed Platforms.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|Mixed Platforms.Deploy.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|x86.ActiveCfg = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|x86.Build.0 = Release|x86 - {82A2958E-AB5B-40B8-A556-DA41952F870F}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Assets/AboutAssets.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Assets/AboutAssets.txt deleted file mode 100644 index 5ddf08729b..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Assets/AboutAssets.txt +++ /dev/null @@ -1,19 +0,0 @@ -Any raw assets you want to be deployed with your application can be placed in -this directory (and child directories) and given a Build Action of "AndroidAsset". - -These files will be deployed with you package and will be accessible using Android's -AssetManager, like this: - -public class ReadAsset : Activity -{ - protected override void OnCreate (Bundle bundle) - { - base.OnCreate (bundle); - - InputStream input = Assets.Open ("my_asset.txt"); - } -} - -Additionally, some Android functions will automatically load asset files: - -Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/GeolocatorSample.Droid.csproj b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/GeolocatorSample.Droid.csproj deleted file mode 100644 index 6d04baf16d..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/GeolocatorSample.Droid.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {FD7768FC-ECB7-4E9C-AFBB-ADEB949B2748} - {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - GeolocatorSample.Droid - GeolocatorSample.Droid - 512 - true - Resources\Resource.Designer.cs - Off - Properties\AndroidManifest.xml - true - armeabi,armeabi-v7a,x86 - - - - - cd56d9b5 - v5.1 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - True - None - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - False - SdkOnly - - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\MonoAndroid10\FormsViewGroup.dll - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\MonoAndroid10\Geolocator.Plugin.dll - True - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\MonoAndroid10\Geolocator.Plugin.Abstractions.dll - True - - - - - - - - - False - ..\..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\MonoAndroid10\Xamarin.Forms.Core.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll - - - - - - - - - - - - - - - - - - - - - - - - - GeolocatorSample - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/MainActivity.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/MainActivity.cs deleted file mode 100644 index 3fcc1151db..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/MainActivity.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -using Android.App; -using Android.Content.PM; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Android.OS; - -namespace GeolocatorSample.Droid -{ - [Activity(Label = "GeolocatorSample", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] - public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity - { - protected override void OnCreate(Bundle bundle) - { - base.OnCreate(bundle); - - global::Xamarin.Forms.Forms.Init(this, bundle); - LoadApplication(new App()); - } - } -} - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/PluginsHelp/GeolocatorReadme.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/PluginsHelp/GeolocatorReadme.txt deleted file mode 100644 index 8a88b0862a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/PluginsHelp/GeolocatorReadme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Connectivity Readme -Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins - -**IMPORTANT** -Android: -You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission - -iOS: -In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. -See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8 - -Windows Phone: -You must set the ID_CAP_LOCATION permission. - -Getting Started: - -var locator = CrossGeolocator.Current; -locator.DesiredAccuracy = 50; - -var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); - -Console.WriteLine ("Position Status: {0}", position.Timestamp); -Console.WriteLine ("Position Latitude: {0}", position.Latitude); -Console.WriteLine ("Position Longitude: {0}", position.Longitude); \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AndroidManifest.xml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AndroidManifest.xml deleted file mode 100644 index b3531db7e4..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AssemblyInfo.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AssemblyInfo.cs deleted file mode 100644 index f729021a89..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Android.App; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GeolocatorSample.Droid")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeolocatorSample.Droid")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -// Add some common permissions, these can be removed if not needed -[assembly: UsesPermission(Android.Manifest.Permission.Internet)] -[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/AboutResources.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/AboutResources.txt deleted file mode 100644 index cb30f20b1c..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/AboutResources.txt +++ /dev/null @@ -1,50 +0,0 @@ -Images, layout descriptions, binary blobs and string dictionaries can be included -in your application as resource files. Various Android APIs are designed to -operate on the resource IDs instead of dealing with images, strings or binary blobs -directly. - -For example, a sample Android app that contains a user interface layout (main.xml), -an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) -would keep its resources in the "Resources" directory of the application: - -Resources/ - drawable-hdpi/ - icon.png - - drawable-ldpi/ - icon.png - - drawable-mdpi/ - icon.png - - layout/ - main.xml - - values/ - strings.xml - -In order to get the build system to recognize Android resources, set the build action to -"AndroidResource". The native Android APIs do not operate directly with filenames, but -instead operate on resource IDs. When you compile an Android application that uses resources, -the build system will package the resources for distribution and generate a class called -"Resource" that contains the tokens for each one of the resources included. For example, -for the above Resources layout, this is what the Resource class would expose: - -public class Resource { - public class drawable { - public const int icon = 0x123; - } - - public class layout { - public const int main = 0x456; - } - - public class strings { - public const int first_string = 0xabc; - public const int second_string = 0xbcd; - } -} - -You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main -to reference the layout/main.xml file, or Resource.strings.first_string to reference the first -string in the dictionary file values/strings.xml. diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/Resource.Designer.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/Resource.Designer.cs deleted file mode 100644 index 3f6dad1853..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/Resource.Designer.cs +++ /dev/null @@ -1,61 +0,0 @@ -#pragma warning disable 1591 -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -[assembly: global::Android.Runtime.ResourceDesignerAttribute("GeolocatorSample.Droid.Resource", IsApplication=true)] - -namespace GeolocatorSample.Droid -{ - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] - public partial class Resource - { - - static Resource() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - public static void UpdateIdValues() - { - } - - public partial class Attribute - { - - static Attribute() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Attribute() - { - } - } - - public partial class Drawable - { - - // aapt resource value: 0x7f020000 - public const int icon = 2130837504; - - static Drawable() - { - global::Android.Runtime.ResourceIdManager.UpdateIdValues(); - } - - private Drawable() - { - } - } - } -} -#pragma warning restore 1591 diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-hdpi/icon.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-hdpi/icon.png deleted file mode 100644 index 964f110abb..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-hdpi/icon.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xhdpi/icon.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xhdpi/icon.png deleted file mode 100644 index 3c01e60ced..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xhdpi/icon.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xxhdpi/icon.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xxhdpi/icon.png deleted file mode 100644 index 0d8c1c57dc..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable-xxhdpi/icon.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable/icon.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable/icon.png deleted file mode 100644 index b0ba7150f4..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/Resources/drawable/icon.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/packages.config b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/packages.config deleted file mode 100644 index bc20bfd5aa..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.Droid/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml deleted file mode 100644 index 0ed159e9e1..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml.cs deleted file mode 100644 index 8707142a91..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/App.xaml.cs +++ /dev/null @@ -1,223 +0,0 @@ -using System; -using System.Diagnostics; -using System.Resources; -using System.Windows; -using System.Windows.Markup; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; -using GeolocatorSample.WinPhone.Resources; - -namespace GeolocatorSample.WinPhone -{ - public partial class App : Application - { - /// - /// Provides easy access to the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public static PhoneApplicationFrame RootFrame { get; private set; } - - /// - /// Constructor for the Application object. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += Application_UnhandledException; - - // Standard XAML initialization - InitializeComponent(); - - // Phone-specific initialization - InitializePhoneApplication(); - - // Language display initialization - InitializeLanguage(); - - // Show graphics profiling information while debugging. - if (Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - //Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are handed off to GPU with a colored overlay. - //Application.Current.Host.Settings.EnableCacheVisualization = true; - - // Prevent the screen from turning off while under the debugger by disabling - // the application's idle detection. - // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run - // and consume battery power when the user is not using the phone. - PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; - } - - } - - // Code to execute when the application is launching (eg, from Start) - // This code will not execute when the application is reactivated - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - // Code to execute when the application is activated (brought to foreground) - // This code will not execute when the application is first launched - private void Application_Activated(object sender, ActivatedEventArgs e) - { - } - - // Code to execute when the application is deactivated (sent to background) - // This code will not execute when the application is closing - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - } - - // Code to execute when the application is closing (eg, user hit Back) - // This code will not execute when the application is deactivated - private void Application_Closing(object sender, ClosingEventArgs e) - { - } - - // Code to execute if a navigation fails - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - Debugger.Break(); - } - } - - // Code to execute on Unhandled Exceptions - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - Debugger.Break(); - } - } - - #region Phone application initialization - - // Avoid double-initialization - private bool phoneApplicationInitialized = false; - - // Do not add any additional code to this method - private void InitializePhoneApplication() - { - if (phoneApplicationInitialized) - return; - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - RootFrame = new PhoneApplicationFrame(); - RootFrame.Navigated += CompleteInitializePhoneApplication; - - // Handle navigation failures - RootFrame.NavigationFailed += RootFrame_NavigationFailed; - - // Handle reset requests for clearing the backstack - RootFrame.Navigated += CheckForResetNavigation; - - // Ensure we don't initialize again - phoneApplicationInitialized = true; - } - - // Do not add any additional code to this method - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != RootFrame) - RootVisual = RootFrame; - - // Remove this handler since it is no longer needed - RootFrame.Navigated -= CompleteInitializePhoneApplication; - } - - private void CheckForResetNavigation(object sender, NavigationEventArgs e) - { - // If the app has received a 'reset' navigation, then we need to check - // on the next navigation to see if the page stack should be reset - if (e.NavigationMode == NavigationMode.Reset) - RootFrame.Navigated += ClearBackStackAfterReset; - } - - private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) - { - // Unregister the event so it doesn't get called again - RootFrame.Navigated -= ClearBackStackAfterReset; - - // Only clear the stack for 'new' (forward) and 'refresh' navigations - if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) - return; - - // For UI consistency, clear the entire page stack - while (RootFrame.RemoveBackEntry() != null) - { - ; // do nothing - } - } - - #endregion - - // Initialize the app's font and flow direction as defined in its localized resource strings. - // - // To ensure that the font of your application is aligned with its supported languages and that the - // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage - // and ResourceFlowDirection should be initialized in each resx file to match these values with that - // file's culture. For example: - // - // AppResources.es-ES.resx - // ResourceLanguage's value should be "es-ES" - // ResourceFlowDirection's value should be "LeftToRight" - // - // AppResources.ar-SA.resx - // ResourceLanguage's value should be "ar-SA" - // ResourceFlowDirection's value should be "RightToLeft" - // - // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072. - // - private void InitializeLanguage() - { - try - { - // Set the font to match the display language defined by the - // ResourceLanguage resource string for each supported language. - // - // Fall back to the font of the neutral language if the Display - // language of the phone is not supported. - // - // If a compiler error is hit then ResourceLanguage is missing from - // the resource file. - RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage); - - // Set the FlowDirection of all elements under the root frame based - // on the ResourceFlowDirection resource string for each - // supported language. - // - // If a compiler error is hit then ResourceFlowDirection is missing from - // the resource file. - FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection); - RootFrame.FlowDirection = flow; - } - catch - { - // If an exception is caught here it is most likely due to either - // ResourceLangauge not being correctly set to a supported language - // code or ResourceFlowDirection is set to a value other than LeftToRight - // or RightToLeft. - - if (Debugger.IsAttached) - { - Debugger.Break(); - } - - throw; - } - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/AlignmentGrid.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/AlignmentGrid.png deleted file mode 100644 index f7d2e97804..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/AlignmentGrid.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/ApplicationIcon.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/ApplicationIcon.png deleted file mode 100644 index d2b5c9524d..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/ApplicationIcon.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileLarge.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileLarge.png deleted file mode 100644 index 8856d9a996..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileLarge.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileMedium.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileMedium.png deleted file mode 100644 index baab0030a7..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileMedium.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileSmall.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileSmall.png deleted file mode 100644 index d44d803a52..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/FlipCycleTileSmall.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileMediumLarge.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileMediumLarge.png deleted file mode 100644 index 2c904389ac..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileMediumLarge.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileSmall.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileSmall.png deleted file mode 100644 index 76d82e0f08..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Assets/Tiles/IconicTileSmall.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/GeolocatorSample.WinPhone.csproj b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/GeolocatorSample.WinPhone.csproj deleted file mode 100644 index a0fdac0d94..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/GeolocatorSample.WinPhone.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {82A2958E-AB5B-40B8-A556-DA41952F870F} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - GeolocatorSample.WinPhone - GeolocatorSample.WinPhone - WindowsPhone - v8.0 - $(TargetFrameworkVersion) - true - - true - true - PhoneApp1_$(Configuration)_$(Platform).xap - Properties\AppManifest.xml - GeolocatorSample.WinPhone.App - true - 11.0 - true - dd928278 - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\x86\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\x86\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - true - full - false - Bin\ARM\Debug - DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\ARM\Release - TRACE;SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - App.xaml - - - - MainPage.xaml - - - - True - True - AppResources.resx - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - Designer - - - - - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - PublicResXFileCodeGenerator - AppResources.Designer.cs - - - - - GeolocatorSample - - - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\wp8\Geolocator.Plugin.dll - True - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\wp8\Geolocator.Plugin.Abstractions.dll - True - - - ..\..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\WP80\Xamarin.Forms.Core.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\WP80\Xamarin.Forms.Platform.WP8.dll - - - False - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\WP80\Xamarin.Forms.Xaml.dll - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/LocalizedStrings.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/LocalizedStrings.cs deleted file mode 100644 index 009f4d4967..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/LocalizedStrings.cs +++ /dev/null @@ -1,14 +0,0 @@ -using GeolocatorSample.WinPhone.Resources; - -namespace GeolocatorSample.WinPhone -{ - /// - /// Provides access to string resources. - /// - public class LocalizedStrings - { - private static AppResources _localizedResources = new AppResources(); - - public AppResources LocalizedResources { get { return _localizedResources; } } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml deleted file mode 100644 index 9d80f4be82..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml.cs deleted file mode 100644 index 0c139dfad0..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/MainPage.xaml.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; - -namespace GeolocatorSample.WinPhone -{ - public partial class MainPage : global::Xamarin.Forms.Platform.WinPhone.FormsApplicationPage - { - public MainPage() - { - InitializeComponent(); - SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape; - - global::Xamarin.Forms.Forms.Init(); - LoadApplication(new GeolocatorSample.App()); - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/PluginsHelp/GeolocatorReadme.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/PluginsHelp/GeolocatorReadme.txt deleted file mode 100644 index 8a88b0862a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/PluginsHelp/GeolocatorReadme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Connectivity Readme -Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins - -**IMPORTANT** -Android: -You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission - -iOS: -In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. -See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8 - -Windows Phone: -You must set the ID_CAP_LOCATION permission. - -Getting Started: - -var locator = CrossGeolocator.Current; -locator.DesiredAccuracy = 50; - -var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); - -Console.WriteLine ("Position Status: {0}", position.Timestamp); -Console.WriteLine ("Position Latitude: {0}", position.Latitude); -Console.WriteLine ("Position Longitude: {0}", position.Longitude); \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AppManifest.xml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AppManifest.xml deleted file mode 100644 index 6712a11783..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AssemblyInfo.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AssemblyInfo.cs deleted file mode 100644 index a8c737b7e4..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Resources; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GeolocatorSample.WinPhone")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeolocatorSample.WinPhone")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("65077432-0c92-466b-b68d-911a8ec84f1d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/WMAppManifest.xml b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/WMAppManifest.xml deleted file mode 100644 index 8a595ebb60..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Properties/WMAppManifest.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Assets\ApplicationIcon.png - - - - - - - - - - - - - - - Assets\Tiles\FlipCycleTileSmall.png - 0 - Assets\Tiles\FlipCycleTileMedium.png - GeolocatorSample.WinPhone - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/README_FIRST.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/README_FIRST.txt deleted file mode 100644 index ce40c013bb..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/README_FIRST.txt +++ /dev/null @@ -1,3 +0,0 @@ -For the Windows Phone toolkit make sure that you have -marked the icons in the "Toolkit.Content" folder as content. That way they -can be used as the icons for the ApplicationBar control. \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.Designer.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.Designer.cs deleted file mode 100644 index dc920da46d..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.Designer.cs +++ /dev/null @@ -1,127 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.17626 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace GeolocatorSample.WinPhone.Resources -{ - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AppResources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AppResources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GeolocatorSample.WinPhone.Resources.AppResources", typeof(AppResources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to LeftToRight. - /// - public static string ResourceFlowDirection - { - get - { - return ResourceManager.GetString("ResourceFlowDirection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to us-EN. - /// - public static string ResourceLanguage - { - get - { - return ResourceManager.GetString("ResourceLanguage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MY APPLICATION. - /// - public static string ApplicationTitle - { - get - { - return ResourceManager.GetString("ApplicationTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to button. - /// - public static string AppBarButtonText - { - get - { - return ResourceManager.GetString("AppBarButtonText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to menu item. - /// - public static string AppBarMenuItemText - { - get - { - return ResourceManager.GetString("AppBarMenuItemText", resourceCulture); - } - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.resx b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.resx deleted file mode 100644 index 569bf520d0..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Resources/AppResources.resx +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - LeftToRight - Controls the FlowDirection for all elements in the RootFrame. Set to the traditional direction of this resource file's language - - - en-US - Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language. - - - MY APPLICATION - - - add - - - Menu Item - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/SplashScreenImage.jpg b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/SplashScreenImage.jpg deleted file mode 100644 index 666f7c537f..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/SplashScreenImage.jpg and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Add.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Add.png deleted file mode 100644 index 4b524d6f14..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Add.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png deleted file mode 100644 index 4dd724f087..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Cancel.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Check.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Check.png deleted file mode 100644 index 7a07466687..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Check.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Delete.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Delete.png deleted file mode 100644 index 95bb16dabe..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Delete.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Select.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Select.png deleted file mode 100644 index 995deaaafb..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/Toolkit.Content/ApplicationBar.Select.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/packages.config b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/packages.config deleted file mode 100644 index f6db49c970..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.WinPhone/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/AppDelegate.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/AppDelegate.cs deleted file mode 100644 index 52ecfd46ec..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/AppDelegate.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Foundation; -using UIKit; - -namespace GeolocatorSample.iOS -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register("AppDelegate")] - public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate - { - // - // This method is invoked when the application has loaded and is ready to run. In this - // method you should instantiate the window, load the UI into it and then make the window - // visible. - // - // You have 17 seconds to return from this method, or iOS will terminate your application. - // - public override bool FinishedLaunching(UIApplication app, NSDictionary options) - { - global::Xamarin.Forms.Forms.Init(); - LoadApplication(new App()); - - return base.FinishedLaunching(app, options); - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Entitlements.plist b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Entitlements.plist deleted file mode 100644 index e9a3005f78..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Entitlements.plist +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/GeolocatorSample.iOS.csproj b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/GeolocatorSample.iOS.csproj deleted file mode 100644 index 7768846b01..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/GeolocatorSample.iOS.csproj +++ /dev/null @@ -1,160 +0,0 @@ - - - - Debug - iPhoneSimulator - 8.0.30703 - 2.0 - {CF64F284-8850-4DC0-ADD4-E066A0744AF3} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - GeolocatorSample.iOS - Resources - GeolocatorSampleiOS - edc5ef5c - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG - prompt - 4 - false - i386, x86_64 - None - true - Entitlements.plist - - - none - true - bin\iPhoneSimulator\Release - prompt - 4 - None - i386, x86_64 - false - Entitlements.plist - - - true - full - false - bin\iPhone\Debug - DEBUG - prompt - 4 - false - ARMv7, ARM64 - iPhone Developer - true - Entitlements.plist - - - none - true - bin\iPhone\Release - prompt - 4 - ARMv7, ARM64 - false - iPhone Developer - Entitlements.plist - - - none - True - bin\iPhone\Ad-Hoc - prompt - 4 - False - ARMv7, ARM64 - True - Automatic:AdHoc - iPhone Distribution - Entitlements.plist - - - none - True - bin\iPhone\AppStore - prompt - 4 - False - ARMv7, ARM64 - Automatic:AppStore - iPhone Distribution - Entitlements.plist - - - - - - - Designer - - - - - - - - - GeolocatorSample - - - - - - - - - - - - - - - - - - - - - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\Xamarin.iOS10\Geolocator.Plugin.dll - True - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\Xamarin.iOS10\Geolocator.Plugin.Abstractions.dll - True - - - - - - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll - - - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll - - - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Info.plist b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Info.plist deleted file mode 100644 index 974c36b26c..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Info.plist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - UIDeviceFamily - - 1 - 2 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - MinimumOSVersion - 6.0 - CFBundleDisplayName - GeolocatorSample - CFBundleIdentifier - com.yourcompany.GeolocatorSample - CFBundleVersion - 1.0 - CFBundleIconFiles - - Icon-60@2x - Icon-60@3x - Icon-76 - Icon-76@2x - Default - Default@2x - Default-568h@2x - Default-Portrait - Default-Portrait@2x - Icon-Small-40 - Icon-Small-40@2x - Icon-Small-40@3x - Icon-Small - Icon-Small@2x - Icon-Small@3x - - UILaunchStoryboardName - LaunchScreen - RequestWhenInUseAuthorization - Need location for geolocator plugin. - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Main.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Main.cs deleted file mode 100644 index 2c2ba1a33a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Main.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Foundation; -using UIKit; - -namespace GeolocatorSample.iOS -{ - public class Application - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, "AppDelegate"); - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/PluginsHelp/GeolocatorReadme.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/PluginsHelp/GeolocatorReadme.txt deleted file mode 100644 index 8a88b0862a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/PluginsHelp/GeolocatorReadme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Connectivity Readme -Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins - -**IMPORTANT** -Android: -You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission - -iOS: -In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. -See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8 - -Windows Phone: -You must set the ID_CAP_LOCATION permission. - -Getting Started: - -var locator = CrossGeolocator.Current; -locator.DesiredAccuracy = 50; - -var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); - -Console.WriteLine ("Position Status: {0}", position.Timestamp); -Console.WriteLine ("Position Latitude: {0}", position.Latitude); -Console.WriteLine ("Position Longitude: {0}", position.Longitude); \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Properties/AssemblyInfo.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Properties/AssemblyInfo.cs deleted file mode 100644 index 6e8e46574e..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GeolocatorSample.iOS")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeolocatorSample.iOS")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-568h@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-568h@2x.png deleted file mode 100644 index 26c6461e50..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-568h@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait.png deleted file mode 100644 index 5d0d1ab4c6..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait@2x.png deleted file mode 100644 index 0ee2688e8f..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default-Portrait@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default.png deleted file mode 100644 index b74643c0aa..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default@2x.png deleted file mode 100644 index dbd6bd3e86..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Default@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@2x.png deleted file mode 100644 index 4b03c42703..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@3x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@3x.png deleted file mode 100644 index b03ca1bbc6..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-60@3x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76.png deleted file mode 100644 index 587982e2a6..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76@2x.png deleted file mode 100644 index cd4e2c8fe7..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-76@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40.png deleted file mode 100644 index 6acff94417..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@2x.png deleted file mode 100644 index b833aac26f..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@3x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@3x.png deleted file mode 100644 index ab8654e499..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small-40@3x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small.png deleted file mode 100644 index 33db7e7141..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@2x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@2x.png deleted file mode 100644 index bf45e25929..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@2x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@3x.png b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@3x.png deleted file mode 100644 index 7ad3891b95..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/Icon-Small@3x.png and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/LaunchScreen.storyboard b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/LaunchScreen.storyboard deleted file mode 100644 index a639c2f1a5..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/Resources/LaunchScreen.storyboard +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork deleted file mode 100644 index 94c8ebd6b2..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork@2x b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork@2x deleted file mode 100644 index fa2ebf72db..0000000000 Binary files a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/iTunesArtwork@2x and /dev/null differ diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/packages.config b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/packages.config deleted file mode 100644 index 8c09ba9996..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample.iOS/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/App.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/App.cs deleted file mode 100644 index 72a43ef3d7..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/App.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Geolocator.Plugin; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Xamarin.Forms; - -namespace GeolocatorSample -{ - public class App : Application - { - public App() - { - - var buttonGetGPS = new Button - { - Text = "GetGPS" - }; - - var labelGPS = new Label - { - Text = "GPS goes here" - }; - - buttonGetGPS.Clicked += async (sender, args) => - { - var locator = CrossGeolocator.Current; - locator.DesiredAccuracy = 50; - labelGPS.Text = "Getting gps"; - - var position = await locator.GetPositionAsync(timeoutMilliseconds: 10000); - - if (position == null) - { - labelGPS.Text = "null gps :("; - return; - } - labelGPS.Text = string.Format("Time: {0} \nLat: {1} \nLong: {2} \n Altitude: {3} \nAltitude Accuracy: {4} \nAccuracy: {5} \n Heading: {6} \n Speed: {7}", - position.Timestamp, position.Latitude, position.Longitude, - position.Altitude, position.AltitudeAccuracy, position.Accuracy, position.Heading, position.Speed); - }; - - // The root page of your application - MainPage = new ContentPage - { - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - buttonGetGPS, - labelGPS - } - } - }; - } - - protected override void OnStart() - { - // Handle when your app starts - } - - protected override void OnSleep() - { - // Handle when your app sleeps - } - - protected override void OnResume() - { - // Handle when your app resumes - } - } -} diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/GeolocatorSample.csproj b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/GeolocatorSample.csproj deleted file mode 100644 index 23e7d0eecb..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/GeolocatorSample.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - - 10.0 - Debug - AnyCPU - {02BB8331-934C-424B-A0ED-438E6F1C39D4} - Library - Properties - GeolocatorSample - GeolocatorSample - v4.5 - Profile78 - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4b7ae233 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Geolocator.Plugin.dll - True - - - ..\..\packages\Xam.Plugin.Geolocator.1.0.3\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Geolocator.Plugin.Abstractions.dll - True - - - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll - - - ..\..\packages\Xamarin.Forms.1.3.4.6332\lib\portable-win+net45+wp80+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/PluginsHelp/GeolocatorReadme.txt b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/PluginsHelp/GeolocatorReadme.txt deleted file mode 100644 index 8a88b0862a..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/PluginsHelp/GeolocatorReadme.txt +++ /dev/null @@ -1,24 +0,0 @@ -Connectivity Readme -Find the most up to date information at: https://github.com/jamesmontemagno/Xamarin.Plugins - -**IMPORTANT** -Android: -You must request ACCESS_COARSE_LOCATION & ACCESS_FINE_LOCATION permission - -iOS: -In iOS 8 you now have to call either RequestWhenInUseAuthorization or RequestAlwaysAuthorization on the location manager. Additionally you need to add either the concisely named NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription to your Info.plist. -See: http://motzcod.es/post/97662738237/scanning-for-ibeacons-in-ios-8 - -Windows Phone: -You must set the ID_CAP_LOCATION permission. - -Getting Started: - -var locator = CrossGeolocator.Current; -locator.DesiredAccuracy = 50; - -var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); - -Console.WriteLine ("Position Status: {0}", position.Timestamp); -Console.WriteLine ("Position Latitude: {0}", position.Latitude); -Console.WriteLine ("Position Longitude: {0}", position.Longitude); \ No newline at end of file diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/Properties/AssemblyInfo.cs b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/Properties/AssemblyInfo.cs deleted file mode 100644 index 3836608f81..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Resources; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("GeolocatorSample")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("GeolocatorSample")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/packages.config b/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/packages.config deleted file mode 100644 index 21206a88c7..0000000000 --- a/src/Mobile/Components/GeolocatorPlugin-1.0.3/samples/GeolocatorSample/GeolocatorSample/GeolocatorSample/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Mobile/Images/AndroidEmulator.png b/src/Mobile/Images/AndroidEmulator.png deleted file mode 100644 index ed449cd296..0000000000 Binary files a/src/Mobile/Images/AndroidEmulator.png and /dev/null differ diff --git a/src/Mobile/Images/Auth.png b/src/Mobile/Images/Auth.png deleted file mode 100644 index 7a85913489..0000000000 Binary files a/src/Mobile/Images/Auth.png and /dev/null differ diff --git a/src/Mobile/Images/Catalog.png b/src/Mobile/Images/Catalog.png deleted file mode 100644 index 5a93d0f2b6..0000000000 Binary files a/src/Mobile/Images/Catalog.png and /dev/null differ diff --git a/src/Mobile/Images/Filter.png b/src/Mobile/Images/Filter.png deleted file mode 100644 index 8b1d12f406..0000000000 Binary files a/src/Mobile/Images/Filter.png and /dev/null differ diff --git a/src/Mobile/Images/MacAgent.png b/src/Mobile/Images/MacAgent.png deleted file mode 100644 index 6f5cb99f09..0000000000 Binary files a/src/Mobile/Images/MacAgent.png and /dev/null differ diff --git a/src/Mobile/Images/OrderDetail.png b/src/Mobile/Images/OrderDetail.png deleted file mode 100644 index 93072f7367..0000000000 Binary files a/src/Mobile/Images/OrderDetail.png and /dev/null differ diff --git a/src/Mobile/Images/Preview.png b/src/Mobile/Images/Preview.png deleted file mode 100644 index 7b63a484f5..0000000000 Binary files a/src/Mobile/Images/Preview.png and /dev/null differ diff --git a/src/Mobile/Images/Profile.png b/src/Mobile/Images/Profile.png deleted file mode 100644 index 1e3b86a45d..0000000000 Binary files a/src/Mobile/Images/Profile.png and /dev/null differ diff --git a/src/Mobile/Images/Settings.png b/src/Mobile/Images/Settings.png deleted file mode 100644 index 8f7661f711..0000000000 Binary files a/src/Mobile/Images/Settings.png and /dev/null differ diff --git a/src/Mobile/Images/ShoppingCart.png b/src/Mobile/Images/ShoppingCart.png deleted file mode 100644 index f3b46c958b..0000000000 Binary files a/src/Mobile/Images/ShoppingCart.png and /dev/null differ diff --git a/src/Mobile/Images/Unsupported52.0.png b/src/Mobile/Images/Unsupported52.0.png deleted file mode 100644 index 193473a054..0000000000 Binary files a/src/Mobile/Images/Unsupported52.0.png and /dev/null differ diff --git a/src/Mobile/Images/Updates.png b/src/Mobile/Images/Updates.png deleted file mode 100644 index db0db0174b..0000000000 Binary files a/src/Mobile/Images/Updates.png and /dev/null differ diff --git a/src/Mobile/Images/could-not-connect-to-the-debugger.png b/src/Mobile/Images/could-not-connect-to-the-debugger.png deleted file mode 100644 index e35fd40b11..0000000000 Binary files a/src/Mobile/Images/could-not-connect-to-the-debugger.png and /dev/null differ diff --git a/src/Mobile/Images/eShopOnContainers_Architecture_Diagram.png b/src/Mobile/Images/eShopOnContainers_Architecture_Diagram.png deleted file mode 100644 index 409582b287..0000000000 Binary files a/src/Mobile/Images/eShopOnContainers_Architecture_Diagram.png and /dev/null differ diff --git a/src/Mobile/Images/launch-hyperv-manager.png b/src/Mobile/Images/launch-hyperv-manager.png deleted file mode 100644 index 8b24a06330..0000000000 Binary files a/src/Mobile/Images/launch-hyperv-manager.png and /dev/null differ diff --git a/src/Mobile/Images/set-compatibility-vs-sml.png b/src/Mobile/Images/set-compatibility-vs-sml.png deleted file mode 100644 index 2244270836..0000000000 Binary files a/src/Mobile/Images/set-compatibility-vs-sml.png and /dev/null differ diff --git a/src/Mobile/Images/vm-settings.png b/src/Mobile/Images/vm-settings.png deleted file mode 100644 index b21ede7804..0000000000 Binary files a/src/Mobile/Images/vm-settings.png and /dev/null differ diff --git a/src/Mobile/README.md b/src/Mobile/README.md index 4a12698b1b..9e0b5e3bed 100644 --- a/src/Mobile/README.md +++ b/src/Mobile/README.md @@ -1,158 +1,2 @@ # eShopOnContainers - -eShopOnContainers is a reference app whose imagined purpose is to serve the mobile workforce of a fictitious company that sells products. The app allow to manage the catalog, view products, manage the basket and the orders. - -eShopOnContainers - -### Supported platforms: iOS, Android and Windows - -### The app architecture consists of two parts: - 1. A Xamarin.Forms mobile app for iOS, Android and Windows. - 2. Several .NET Web API microservices deployed as Docker containers. - -### Xamarin.Forms App (eShopOnContainers) - -This project exercises the following platforms, frameworks or features: - -* Xamarin.Forms - * XAML - * Behaviors - * Bindings - * Converters - * Central Styles - * Custom Renderers - * Animations - * IoC - * Messaging Center - * Custom Controls - * Cross Plugins - * XFGloss -* xUnit Tests -* Azure Mobile Services - * C# backend - * WebAPI - * Entity Framework - * Identity Server 4 - -## Three platforms -The app targets **three** platforms: - -* iOS -* Android -* Universal Windows Platform (UWP) - * UWP supported only in Visual Studio, not Xamarin Studio or Visual Studio for MacOS - - -As of 07/03/2017, eShopOnContainers features **89.2% code share** (7.2% iOS / 16.7% Android / 8.7% Windows). - -## Licenses - -This project uses some third-party assets with a license that requires attribution: - -- [Xamarin.Plugins](https://github.com/jamesmontemagno/Xamarin.Plugins): by James Montemagno -- [FFImageLoading](https://github.com/daniel-luberda/FFImageLoading): by Daniel Luberda -- [ACR User Dialogs](https://github.com/aritchie/userdialogs): by Allan Ritchie -- [Xamarin.Forms Animation Helpers](https://github.com/jsuarezruiz/Xamanimation): by Javier Suárez -- [SlideOverKit](https://github.com/XAM-Consulting/SlideOverKit): by XAM-Consulting - -## Requirements -### Requirements for March 2017 version of eShopOnContainers - -* [Visual Studio __2015__](https://www.visualstudio.com/en-us/products/vs-2015-product-editions.aspx) (14.0 or higher) to compile C# 6 langage features (or Visual Studio MacOS) -* Xamarin add-ons for Visual Studio (available via the Visual Studio installer) -* __Visual Studio Community Edition is fully supported!__ -* [Android SDK Tools](https://developer.xamarin.com/guides/android/getting_started/installation/windows/) 25.2.3 or higher -* JDK 8.0 - -## Setup - -#### [1. Ensure the Xamarin platform is installed](http://developer.xamarin.com/guides/cross-platform/getting_started/installation/) - -#### 2. Ensure Xamarin are updated -Xamarin will periodically automatically check for updates. You can also manually check for updates. - -Ensure Xamarin are updated - -### 3. Project Setup - -Restore NuGet packages for the project. - -### 4. Ensure Android Emulator is installed -You can use any Android emulator although it is highly recommended to use an x86 based version. - -Visual Studio Android Emulator - -**Note**: The Visual Studio Android Emulator cannot run well inside a virtual machine or over Remote Desktop or VNC since it relies on virtualization and OpenGL. - -To deploy and debug the application on a physical device, refer to these [link](https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-device/). - -### 5. Ensure Mac connection -To set up the Mac host, you must enable communication between the Xamarin extension for Visual Studio and your Mac. - -Connect with a Mac - -## Screens - -The app has the following screens: - -* a auth screen -* a catalog list -* a profile section with a order list -* a readonly order detail screen -* a customizable basket -* a checkout screen - -Login -Catalog -Filter catalog -Profile -Order details -Basket -Settings - -## Clean and Rebuild -If you see build issues when pulling updates from the repo, try cleaning and rebuilding the solution. - -## Troubleshooting - -**Unsupported major.minor version 52.0** - -So, you just downloaded the source code and ready to build the application and... - -Unsupported major.minor version 52.0 - -We have two possible fixes. - -The first one is based on updating Java JDK and ensure its use. The version 52.0 referenced in the error refers to the JDK, specifically to version 8. Xamarin Android 7.0 requires the JDK 1.8 to use the Android Nougat APIs (API Level 24). It is also necessary a 64-bit version to be able to use personal controls in the Android editor among other actions. - -Download the corresponding version of the JDK in this [link](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). - -After downloading and installing, we must ensure that the installed version is used. For that: - -Visual Studio: Tools> Options> Xamarin> Android Settings> Java Development Kit Location. -Xamarin Studio (on Mac): Xamarin Studio> Preferences> Projects> SDK Locations> Android> Java SDK (JDK). - -The second way is based on using Android 6.0 or what is the same API Level 23. - -**Could not connect to the debugger using Android Hyper-V emulators** - -The application performs the deployment and even boots into the emulator, but stops immediately without allowing debugging. We get the message: - -Could not connect to the debugger - -The error is related with incompatibilities between the host processor and the Hyper-V virtual machine. - -In Windows 10, we press the start button and write MMC. Next, click the Hyper-V Manager option: - -Could not connect to the debugger - -In the Hyper-V machine management tool (emulators) we select the one that we want to use and we right click, Settings. - -Virtual machine settings - -In the configuration window of the machine, go to the Compatibility section and enable **Migrate to a physical computer with a different processor version**: - -Migrate to a physical computer with a different processor version - -## Copyright and license -* Code and documentation copyright 2017 Microsoft Corp. Code released under the [MIT license](https://opensource.org/licenses/MIT). +The content of this folder has been moved to the repository - [eshop-mobile-client](https://github.com/dotnet-architecture/eshop-mobile-client) diff --git a/src/Mobile/eShopOnContainers-Android.sln b/src/Mobile/eShopOnContainers-Android.sln deleted file mode 100644 index 3782286c06..0000000000 --- a/src/Mobile/eShopOnContainers-Android.sln +++ /dev/null @@ -1,314 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F6-4D07-B109-DA28AD288A63}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}" - ProjectSection(SolutionItems) = preProject - ..\docker-compose.yml = ..\docker-compose.yml - ..\NuGet.config = ..\NuGet.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{F61357CE-1CC2-410E-8776-B16EEBC98EB8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A857AD10-40FF-4303-BEC2-FF1C58D5735E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "eShopOnContainers\eShopOnContainers.Core\eShopOnContainers.Core.csproj", "{67F9D3A8-F71E-4428-913F-C37AE82CDB24}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Droid", "eShopOnContainers\eShopOnContainers.Droid\eShopOnContainers.Droid.csproj", "{62DBB163-9CA9-4818-B48B-13233DF37C24}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared Code", "Shared Code", "{778289CA-31F7-4464-8C2A-612EE846F8A7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{9CC7814B-72A6-465B-A61C-57B512DEE303}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{B7B1D395-4E06-4036-BE86-C216756B9367}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.UnitTests", "eShopOnContainers\eShopOnContainers.UnitTests\eShopOnContainers.UnitTests.csproj", "{F7B6A162-BC4D-4924-B16A-713F9B0344E7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.Droid", "eShopOnContainers\eShopOnContainers.TestRunner.Droid\eShopOnContainers.TestRunner.Droid.csproj", "{A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Ad-Hoc|Any CPU = Ad-Hoc|Any CPU - Ad-Hoc|ARM = Ad-Hoc|ARM - Ad-Hoc|iPhone = Ad-Hoc|iPhone - Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator - Ad-Hoc|x64 = Ad-Hoc|x64 - Ad-Hoc|x86 = Ad-Hoc|x86 - AppStore|Any CPU = AppStore|Any CPU - AppStore|ARM = AppStore|ARM - AppStore|iPhone = AppStore|iPhone - AppStore|iPhoneSimulator = AppStore|iPhoneSimulator - AppStore|x64 = AppStore|x64 - AppStore|x86 = AppStore|x86 - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|iPhone = Release|iPhone - Release|iPhoneSimulator = Release|iPhoneSimulator - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x86.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|ARM.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|ARM.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhone.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x64.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x64.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x86.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x86.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.Deploy.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x86.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|ARM.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhone.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x64.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x64.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x86.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x86.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.Deploy.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F61357CE-1CC2-410E-8776-B16EEBC98EB8} = {932D8224-11F6-4D07-B109-DA28AD288A63} - {67F9D3A8-F71E-4428-913F-C37AE82CDB24} = {778289CA-31F7-4464-8C2A-612EE846F8A7} - {62DBB163-9CA9-4818-B48B-13233DF37C24} = {9CC7814B-72A6-465B-A61C-57B512DEE303} - {778289CA-31F7-4464-8C2A-612EE846F8A7} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {9CC7814B-72A6-465B-A61C-57B512DEE303} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {B7B1D395-4E06-4036-BE86-C216756B9367} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E} - {F7B6A162-BC4D-4924-B16A-713F9B0344E7} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1} = {B7B1D395-4E06-4036-BE86-C216756B9367} - EndGlobalSection -EndGlobal diff --git a/src/Mobile/eShopOnContainers-MobileApps.sln b/src/Mobile/eShopOnContainers-MobileApps.sln deleted file mode 100644 index b10b8a8183..0000000000 --- a/src/Mobile/eShopOnContainers-MobileApps.sln +++ /dev/null @@ -1,523 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F6-4D07-B109-DA28AD288A63}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}" - ProjectSection(SolutionItems) = preProject - ..\docker-compose.yml = ..\docker-compose.yml - ..\NuGet.config = ..\NuGet.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{F61357CE-1CC2-410E-8776-B16EEBC98EB8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A857AD10-40FF-4303-BEC2-FF1C58D5735E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Droid", "eShopOnContainers\eShopOnContainers.Droid\eShopOnContainers.Droid.csproj", "{62DBB163-9CA9-4818-B48B-13233DF37C24}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.iOS", "eShopOnContainers\eShopOnContainers.iOS\eShopOnContainers.iOS.csproj", "{6EEB23DC-7063-4444-9AF8-90DF24F549C0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Windows", "eShopOnContainers\eShopOnContainers.Windows\eShopOnContainers.Windows.csproj", "{C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared Code", "Shared Code", "{778289CA-31F7-4464-8C2A-612EE846F8A7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{9CC7814B-72A6-465B-A61C-57B512DEE303}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{B7B1D395-4E06-4036-BE86-C216756B9367}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.Droid", "eShopOnContainers\eShopOnContainers.TestRunner.Droid\eShopOnContainers.TestRunner.Droid.csproj", "{A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.iOS", "eShopOnContainers\eShopOnContainers.TestRunner.iOS\eShopOnContainers.TestRunner.iOS.csproj", "{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.Windows", "eShopOnContainers\eShopOnContainers.TestRunner.Windows\eShopOnContainers.TestRunner.Windows.csproj", "{A7337243-33B8-463A-87AD-944B75EFD820}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.UnitTests", "eShopOnContainers\eShopOnContainers.UnitTests\eShopOnContainers.UnitTests.csproj", "{FDD910BC-DF0F-483D-B7D5-C7D831855172}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "eShopOnContainers\eShopOnContainers.Core\eShopOnContainers.Core.csproj", "{76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Ad-Hoc|Any CPU = Ad-Hoc|Any CPU - Ad-Hoc|ARM = Ad-Hoc|ARM - Ad-Hoc|iPhone = Ad-Hoc|iPhone - Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator - Ad-Hoc|x64 = Ad-Hoc|x64 - Ad-Hoc|x86 = Ad-Hoc|x86 - AppStore|Any CPU = AppStore|Any CPU - AppStore|ARM = AppStore|ARM - AppStore|iPhone = AppStore|iPhone - AppStore|iPhoneSimulator = AppStore|iPhoneSimulator - AppStore|x64 = AppStore|x64 - AppStore|x86 = AppStore|x86 - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|iPhone = Release|iPhone - Release|iPhoneSimulator = Release|iPhoneSimulator - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.AppStore|x86.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|ARM.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhone.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x64.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.ActiveCfg = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.Build.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Debug|x86.Deploy.0 = Debug|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|Any CPU.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|ARM.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhone.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x64.Deploy.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.ActiveCfg = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.Build.0 = Release|Any CPU - {62DBB163-9CA9-4818-B48B-13233DF37C24}.Release|x86.Deploy.0 = Release|Any CPU - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|ARM.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhone.Build.0 = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|x64.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|x86.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|Any CPU.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|Any CPU.Build.0 = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|ARM.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhone.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhone.Build.0 = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|x64.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|x86.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|Any CPU.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|ARM.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhone.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhone.Build.0 = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|x64.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|x86.ActiveCfg = Release|iPhone - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|Any CPU.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|Any CPU.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|Any CPU.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|ARM.ActiveCfg = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|ARM.Build.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|ARM.Deploy.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhone.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhone.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhone.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x64.ActiveCfg = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x64.Build.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x64.Deploy.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x86.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x86.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Ad-Hoc|x86.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|Any CPU.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|Any CPU.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|Any CPU.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|ARM.ActiveCfg = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|ARM.Build.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|ARM.Deploy.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhone.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhone.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhone.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhoneSimulator.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhoneSimulator.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|iPhoneSimulator.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x64.ActiveCfg = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x64.Build.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x64.Deploy.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x86.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x86.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.AppStore|x86.Deploy.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|Any CPU.ActiveCfg = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|Any CPU.Build.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|Any CPU.Deploy.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|ARM.ActiveCfg = Debug|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|ARM.Build.0 = Debug|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|ARM.Deploy.0 = Debug|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhone.ActiveCfg = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhone.Build.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhone.Deploy.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.ActiveCfg = Debug|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.Build.0 = Debug|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x64.Deploy.0 = Debug|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x86.ActiveCfg = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x86.Build.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Debug|x86.Deploy.0 = Debug|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|Any CPU.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|ARM.ActiveCfg = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|ARM.Build.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|ARM.Deploy.0 = Release|ARM - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|iPhone.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|iPhoneSimulator.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x64.ActiveCfg = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x64.Build.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x64.Deploy.0 = Release|x64 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x86.ActiveCfg = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x86.Build.0 = Release|x86 - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B}.Release|x86.Deploy.0 = Release|x86 - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.AppStore|x86.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|ARM.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhone.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x64.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.ActiveCfg = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.Build.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Debug|x86.Deploy.0 = Debug|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|Any CPU.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|ARM.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhone.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x64.Deploy.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.ActiveCfg = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.Build.0 = Release|Any CPU - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1}.Release|x86.Deploy.0 = Release|Any CPU - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|ARM.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhone.Build.0 = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|x64.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|x86.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|Any CPU.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|Any CPU.Build.0 = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|ARM.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhone.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhone.Build.0 = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|x64.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|x86.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|Any CPU.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|ARM.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhone.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhone.Build.0 = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x64.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x86.ActiveCfg = Release|iPhone - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|Any CPU.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|Any CPU.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|Any CPU.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|ARM.ActiveCfg = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|ARM.Build.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|ARM.Deploy.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhone.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhone.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhone.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x64.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x64.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x64.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x86.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x86.Build.0 = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Ad-Hoc|x86.Deploy.0 = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|Any CPU.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|Any CPU.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|Any CPU.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|ARM.ActiveCfg = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|ARM.Build.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|ARM.Deploy.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhone.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhone.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhone.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhoneSimulator.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhoneSimulator.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|iPhoneSimulator.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x64.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x64.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x64.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x86.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x86.Build.0 = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.AppStore|x86.Deploy.0 = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|Any CPU.ActiveCfg = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|Any CPU.Build.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|Any CPU.Deploy.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|ARM.ActiveCfg = Debug|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|ARM.Build.0 = Debug|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|ARM.Deploy.0 = Debug|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|iPhone.ActiveCfg = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|iPhone.Build.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|iPhone.Deploy.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x64.ActiveCfg = Debug|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x64.Build.0 = Debug|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x64.Deploy.0 = Debug|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x86.ActiveCfg = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x86.Build.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Debug|x86.Deploy.0 = Debug|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|Any CPU.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|ARM.ActiveCfg = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|ARM.Build.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|ARM.Deploy.0 = Release|ARM - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|iPhone.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|iPhoneSimulator.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x64.ActiveCfg = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x64.Build.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x64.Deploy.0 = Release|x64 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x86.ActiveCfg = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x86.Build.0 = Release|x86 - {A7337243-33B8-463A-87AD-944B75EFD820}.Release|x86.Deploy.0 = Release|x86 - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|Any CPU.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|ARM.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|ARM.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|iPhone.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|x64.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|x64.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|x86.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.AppStore|x86.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|ARM.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|ARM.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|iPhone.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|x64.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|x64.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Debug|x86.Build.0 = Debug|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|Any CPU.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|ARM.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|ARM.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|iPhone.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|iPhone.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|x64.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|x64.Build.0 = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|x86.ActiveCfg = Release|Any CPU - {FDD910BC-DF0F-483D-B7D5-C7D831855172}.Release|x86.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|Any CPU.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|ARM.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|ARM.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|iPhone.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|x64.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|x64.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|x86.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.AppStore|x86.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|ARM.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|iPhone.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|x64.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|x64.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|x86.ActiveCfg = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Debug|x86.Build.0 = Debug|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|Any CPU.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|ARM.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|ARM.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|iPhone.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|iPhone.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|x64.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|x64.Build.0 = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|x86.ActiveCfg = Release|Any CPU - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F61357CE-1CC2-410E-8776-B16EEBC98EB8} = {932D8224-11F6-4D07-B109-DA28AD288A63} - {62DBB163-9CA9-4818-B48B-13233DF37C24} = {9CC7814B-72A6-465B-A61C-57B512DEE303} - {6EEB23DC-7063-4444-9AF8-90DF24F549C0} = {9CC7814B-72A6-465B-A61C-57B512DEE303} - {C3C1E2CF-B1F7-4654-BBDC-50143DB22E0B} = {9CC7814B-72A6-465B-A61C-57B512DEE303} - {778289CA-31F7-4464-8C2A-612EE846F8A7} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {9CC7814B-72A6-465B-A61C-57B512DEE303} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {B7B1D395-4E06-4036-BE86-C216756B9367} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E} - {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {A7337243-33B8-463A-87AD-944B75EFD820} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {FDD910BC-DF0F-483D-B7D5-C7D831855172} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {76C5F2A7-6CD5-49EA-9F33-EC44DE6539C7} = {778289CA-31F7-4464-8C2A-612EE846F8A7} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8A9E878A-C296-4615-97AB-7A4505148872} - EndGlobalSection -EndGlobal diff --git a/src/Mobile/eShopOnContainers-iOS.sln b/src/Mobile/eShopOnContainers-iOS.sln deleted file mode 100644 index 87b7db9ec8..0000000000 --- a/src/Mobile/eShopOnContainers-iOS.sln +++ /dev/null @@ -1,237 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{932D8224-11F6-4D07-B109-DA28AD288A63}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3AF739CD-81D8-428D-A08A-0A58372DEBF6}" - ProjectSection(SolutionItems) = preProject - docker-compose.yml = docker-compose.yml - global.json = global.json - NuGet.config = NuGet.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{F61357CE-1CC2-410E-8776-B16EEBC98EB8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A857AD10-40FF-4303-BEC2-FF1C58D5735E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "eShopOnContainers\eShopOnContainers.Core\eShopOnContainers.Core.csproj", "{67F9D3A8-F71E-4428-913F-C37AE82CDB24}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.iOS", "eShopOnContainers\eShopOnContainers.iOS\eShopOnContainers.iOS.csproj", "{6EEB23DC-7063-4444-9AF8-90DF24F549C0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared Code", "Shared Code", "{778289CA-31F7-4464-8C2A-612EE846F8A7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{9CC7814B-72A6-465B-A61C-57B512DEE303}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile Apps", "Mobile Apps", "{B7B1D395-4E06-4036-BE86-C216756B9367}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.UnitTests", "eShopOnContainers\eShopOnContainers.UnitTests\eShopOnContainers.UnitTests.csproj", "{F7B6A162-BC4D-4924-B16A-713F9B0344E7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.iOS", "eShopOnContainers\eShopOnContainers.TestRunner.iOS\eShopOnContainers.TestRunner.iOS.csproj", "{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Ad-Hoc|Any CPU = Ad-Hoc|Any CPU - Ad-Hoc|ARM = Ad-Hoc|ARM - Ad-Hoc|iPhone = Ad-Hoc|iPhone - Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator - Ad-Hoc|x64 = Ad-Hoc|x64 - Ad-Hoc|x86 = Ad-Hoc|x86 - AppStore|Any CPU = AppStore|Any CPU - AppStore|ARM = AppStore|ARM - AppStore|iPhone = AppStore|iPhone - AppStore|iPhoneSimulator = AppStore|iPhoneSimulator - AppStore|x64 = AppStore|x64 - AppStore|x86 = AppStore|x86 - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|iPhone = Debug|iPhone - Debug|iPhoneSimulator = Debug|iPhoneSimulator - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|iPhone = Release|iPhone - Release|iPhoneSimulator = Release|iPhoneSimulator - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.AppStore|x86.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|Any CPU.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|ARM.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|ARM.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhone.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x64.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x64.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x86.ActiveCfg = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Debug|x86.Build.0 = Debug|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|Any CPU.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|Any CPU.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|ARM.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|ARM.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhone.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhone.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x64.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x64.Build.0 = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x86.ActiveCfg = Release|Any CPU - {67F9D3A8-F71E-4428-913F-C37AE82CDB24}.Release|x86.Build.0 = Release|Any CPU - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|ARM.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhone.Build.0 = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|x64.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.AppStore|x86.ActiveCfg = AppStore|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|Any CPU.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|Any CPU.Build.0 = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|ARM.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhone.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhone.Build.0 = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|x64.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Debug|x86.ActiveCfg = Debug|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|Any CPU.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|ARM.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhone.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhone.Build.0 = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|x64.ActiveCfg = Release|iPhone - {6EEB23DC-7063-4444-9AF8-90DF24F549C0}.Release|x86.ActiveCfg = Release|iPhone - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|x86.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.AppStore|x86.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|ARM.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|ARM.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhone.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x64.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x64.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x86.ActiveCfg = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Debug|x86.Build.0 = Debug|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|Any CPU.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|ARM.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|ARM.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhone.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhone.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x64.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x64.Build.0 = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x86.ActiveCfg = Release|Any CPU - {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Release|x86.Build.0 = Release|Any CPU - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|ARM.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhone.Build.0 = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|x64.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.AppStore|x86.ActiveCfg = AppStore|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|Any CPU.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|Any CPU.Build.0 = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|ARM.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhone.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhone.Build.0 = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|x64.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Debug|x86.ActiveCfg = Debug|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|Any CPU.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|ARM.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhone.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhone.Build.0 = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x64.ActiveCfg = Release|iPhone - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x86.ActiveCfg = Release|iPhone - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F61357CE-1CC2-410E-8776-B16EEBC98EB8} = {932D8224-11F6-4D07-B109-DA28AD288A63} - {67F9D3A8-F71E-4428-913F-C37AE82CDB24} = {778289CA-31F7-4464-8C2A-612EE846F8A7} - {6EEB23DC-7063-4444-9AF8-90DF24F549C0} = {9CC7814B-72A6-465B-A61C-57B512DEE303} - {778289CA-31F7-4464-8C2A-612EE846F8A7} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {9CC7814B-72A6-465B-A61C-57B512DEE303} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} - {B7B1D395-4E06-4036-BE86-C216756B9367} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E} - {F7B6A162-BC4D-4924-B16A-713F9B0344E7} = {B7B1D395-4E06-4036-BE86-C216756B9367} - {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} = {B7B1D395-4E06-4036-BE86-C216756B9367} - EndGlobalSection -EndGlobal diff --git a/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Bold.ttf b/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Bold.ttf deleted file mode 100644 index ae33a45381..0000000000 Binary files a/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Bold.ttf and /dev/null differ diff --git a/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Regular.ttf b/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Regular.ttf deleted file mode 100644 index 5b4b5afe6e..0000000000 Binary files a/src/Mobile/eShopOnContainers/CommonResources/Fonts/Montserrat-Regular.ttf and /dev/null differ diff --git a/src/Mobile/eShopOnContainers/CommonResources/Fonts/SourceSansPro-Regular.ttf b/src/Mobile/eShopOnContainers/CommonResources/Fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index ffe27865aa..0000000000 Binary files a/src/Mobile/eShopOnContainers/CommonResources/Fonts/SourceSansPro-Regular.ttf and /dev/null differ diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/AnimationBase.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/AnimationBase.cs deleted file mode 100644 index 95e784b2b5..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/AnimationBase.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Diagnostics; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Animations.Base -{ - public abstract class AnimationBase : BindableObject - { - private bool _isRunning = false; - - public static readonly BindableProperty TargetProperty = BindableProperty.Create("Target", typeof(VisualElement), typeof(AnimationBase), null, - propertyChanged: (bindable, oldValue, newValue) => ((AnimationBase)bindable).Target = (VisualElement)newValue); - - public VisualElement Target - { - get { return (VisualElement)GetValue(TargetProperty); } - set { SetValue(TargetProperty, value); } - } - - public static readonly BindableProperty DurationProperty = BindableProperty.Create("Duration", typeof(string), typeof(AnimationBase), "1000", - propertyChanged: (bindable, oldValue, newValue) => ((AnimationBase)bindable).Duration = (string)newValue); - - public string Duration - { - get { return (string)GetValue(DurationProperty); } - set { SetValue(DurationProperty, value); } - } - - public static readonly BindableProperty EasingProperty = BindableProperty.Create("Easing", typeof(EasingType), typeof(AnimationBase), EasingType.Linear, - propertyChanged: (bindable, oldValue, newValue) => ((AnimationBase)bindable).Easing = (EasingType)newValue); - - public EasingType Easing - { - get { return (EasingType)GetValue(EasingProperty); } - set { SetValue(EasingProperty, value); } - } - - public static readonly BindableProperty RepeatForeverProperty = BindableProperty.Create("RepeatForever", typeof(bool), typeof(AnimationBase), false, - propertyChanged: (bindable, oldValue, newValue) => ((AnimationBase)bindable).RepeatForever = (bool)newValue); - - public bool RepeatForever - { - get { return (bool)GetValue(RepeatForeverProperty); } - set { SetValue(RepeatForeverProperty, value); } - } - - public static readonly BindableProperty DelayProperty = BindableProperty.Create("Delay", typeof(int), typeof(AnimationBase), 0, - propertyChanged: (bindable, oldValue, newValue) => ((AnimationBase)bindable).Delay = (int)newValue); - - public int Delay - { - get { return (int)GetValue(DelayProperty); } - set { SetValue(DelayProperty, value); } - } - - protected abstract Task BeginAnimation(); - - public async Task Begin() - { - try - { - if (!_isRunning) - { - _isRunning = true; - - await InternalBegin() - .ContinueWith(t => t.Exception, TaskContinuationOptions.OnlyOnFaulted) - .ConfigureAwait(false); - } - } - catch (TaskCanceledException) - { - } - catch (Exception ex) - { - Debug.WriteLine($"Exception in animation {ex}"); - } - } - - protected abstract Task ResetAnimation(); - - public async Task Reset() - { - _isRunning = false; - await ResetAnimation(); - } - - private async Task InternalBegin() - { - if (Delay > 0) - { - await Task.Delay(Delay); - } - - if (!RepeatForever) - { - await BeginAnimation(); - } - else - { - do - { - await BeginAnimation(); - await ResetAnimation(); - } while (RepeatForever); - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/EasingType.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/EasingType.cs deleted file mode 100644 index 3e678191b8..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/Base/EasingType.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace eShopOnContainers.Core.Animations.Base -{ - public enum EasingType - { - BounceIn, - BounceOut, - CubicIn, - CubicInOut, - CubicOut, - Linear, - SinIn, - SinInOut, - SinOut, - SpringIn, - SpringOut - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/FadeToAnimation.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/FadeToAnimation.cs deleted file mode 100644 index 805d7813a2..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/FadeToAnimation.cs +++ /dev/null @@ -1,163 +0,0 @@ -using eShopOnContainers.Core.Animations.Base; -using eShopOnContainers.Core.Helpers; -using System; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Animations -{ - public class FadeToAnimation : AnimationBase - { - public static readonly BindableProperty OpacityProperty = - BindableProperty.Create("Opacity", typeof(double), typeof(FadeToAnimation), 0.0d, - propertyChanged: (bindable, oldValue, newValue) => - ((FadeToAnimation)bindable).Opacity = (double)newValue); - - public double Opacity - { - get { return (double)GetValue(OpacityProperty); } - set { SetValue(OpacityProperty, value); } - } - - protected override Task BeginAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Target.FadeTo(Opacity, Convert.ToUInt32(Duration), EasingHelper.GetEasing(Easing)); - } - - protected override Task ResetAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Target.FadeTo(0, 0, null); - } - } - - public class FadeInAnimation : AnimationBase - { - public enum FadeDirection - { - Up, - Down - } - - public static readonly BindableProperty DirectionProperty = - BindableProperty.Create("Direction", typeof(FadeDirection), typeof(FadeInAnimation), FadeDirection.Up, - propertyChanged: (bindable, oldValue, newValue) => - ((FadeInAnimation)bindable).Direction = (FadeDirection)newValue); - - public FadeDirection Direction - { - get { return (FadeDirection)GetValue(DirectionProperty); } - set { SetValue(DirectionProperty, value); } - } - - protected override Task BeginAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Task.Run(() => - { - Device.BeginInvokeOnMainThread(() => - { - Target.Animate("FadeIn", FadeIn(), 16, Convert.ToUInt32(Duration)); - }); - }); - } - - protected override Task ResetAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Target.FadeTo(0, 0, null); - } - - internal Animation FadeIn() - { - var animation = new Animation(); - - animation.WithConcurrent((f) => Target.Opacity = f, 0, 1, Xamarin.Forms.Easing.CubicOut); - - animation.WithConcurrent( - (f) => Target.TranslationY = f, - Target.TranslationY + ((Direction == FadeDirection.Up) ? 50 : -50), Target.TranslationY, - Xamarin.Forms.Easing.CubicOut, 0, 1); - - return animation; - } - } - - public class FadeOutAnimation : AnimationBase - { - public enum FadeDirection - { - Up, - Down - } - - public static readonly BindableProperty DirectionProperty = - BindableProperty.Create("Direction", typeof(FadeDirection), typeof(FadeOutAnimation), FadeDirection.Up, - propertyChanged: (bindable, oldValue, newValue) => - ((FadeOutAnimation)bindable).Direction = (FadeDirection)newValue); - - public FadeDirection Direction - { - get { return (FadeDirection)GetValue(DirectionProperty); } - set { SetValue(DirectionProperty, value); } - } - - protected override Task BeginAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Task.Run(() => - { - Device.BeginInvokeOnMainThread(() => - { - Target.Animate("FadeOut", FadeOut(), 16, Convert.ToUInt32(Duration)); - }); - }); - } - - protected override Task ResetAnimation() - { - if (Target == null) - { - throw new NullReferenceException("Null Target property."); - } - - return Target.FadeTo(0, 0, null); - } - - internal Animation FadeOut() - { - var animation = new Animation(); - - animation.WithConcurrent( - (f) => Target.Opacity = f, - 1, 0); - - animation.WithConcurrent( - (f) => Target.TranslationY = f, - Target.TranslationY, Target.TranslationY + ((Direction == FadeDirection.Up) ? 50 : -50)); - - return animation; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/StoryBoard.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/StoryBoard.cs deleted file mode 100644 index 21b672f333..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Animations/StoryBoard.cs +++ /dev/null @@ -1,48 +0,0 @@ -using eShopOnContainers.Core.Animations.Base; -using System.Collections.Generic; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Animations -{ - [ContentProperty("Animations")] - public class StoryBoard : AnimationBase - { - public StoryBoard() - { - Animations = new List(); - } - - public StoryBoard(List animations) - { - Animations = animations; - } - - public List Animations - { - get; - } - - protected override async Task BeginAnimation() - { - foreach (var animation in Animations) - { - if (animation.Target == null) - animation.Target = Target; - - await animation.Begin(); - } - } - - protected override async Task ResetAnimation() - { - foreach (var animation in Animations) - { - if (animation.Target == null) - animation.Target = Target; - - await animation.Reset(); - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml deleted file mode 100644 index 367946ca8e..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - #ffffff - #000000 - #F4F6FA - #00857D - #83D01B - #00A69C - #00857D - #e2e2e2 - #ff5252 - #757575 - #FFFFFF - #979797 - #007aff - #CCCCCC - #C9C9C9 - Transparent - Transparent - #007aff - #FFFFFF - #007aff - Transparent - #FFFFFF - #1FAECE - Transparent - Transparent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs deleted file mode 100644 index 207d076f93..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs +++ /dev/null @@ -1,108 +0,0 @@ -using eShopOnContainers.Core.Models.Location; -using eShopOnContainers.Core.Services.Dependency; -using eShopOnContainers.Core.Services.Location; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using eShopOnContainers.Services; -using System; -using System.Diagnostics; -using System.Globalization; -using System.Threading.Tasks; -using Xamarin.Forms; -using Xamarin.Forms.Xaml; - -[assembly: XamlCompilation(XamlCompilationOptions.Compile)] -namespace eShopOnContainers -{ - public partial class App : Application - { - ISettingsService _settingsService; - - public App() - { - InitializeComponent(); - - InitApp(); - if (Device.RuntimePlatform == Device.UWP) - { - InitNavigation(); - } - } - - private void InitApp() - { - _settingsService = ViewModelLocator.Resolve(); - if (!_settingsService.UseMocks) - ViewModelLocator.UpdateDependencies(_settingsService.UseMocks); - } - - private Task InitNavigation() - { - var navigationService = ViewModelLocator.Resolve(); - return navigationService.InitializeAsync(); - } - - protected override async void OnStart() - { - base.OnStart(); - - if (Device.RuntimePlatform != Device.UWP) - { - await InitNavigation(); - } - if (_settingsService.AllowGpsLocation && !_settingsService.UseFakeLocation) - { - await GetGpsLocation(); - } - if (!_settingsService.UseMocks && !string.IsNullOrEmpty(_settingsService.AuthAccessToken)) - { - await SendCurrentLocation(); - } - - base.OnResume(); - } - - protected override void OnSleep() - { - // Handle when your app sleeps - } - - private async Task GetGpsLocation() - { - var dependencyService = ViewModelLocator.Resolve(); - var locator = dependencyService.Get(); - - if (locator.IsGeolocationEnabled && locator.IsGeolocationAvailable) - { - locator.DesiredAccuracy = 50; - - try - { - var position = await locator.GetPositionAsync(); - _settingsService.Latitude = position.Latitude.ToString(); - _settingsService.Longitude = position.Longitude.ToString(); - } - catch (Exception ex) - { - Debug.WriteLine(ex); - } - } - else - { - _settingsService.AllowGpsLocation = false; - } - } - - private async Task SendCurrentLocation() - { - var location = new Location - { - Latitude = double.Parse(_settingsService.Latitude, CultureInfo.InvariantCulture), - Longitude = double.Parse(_settingsService.Longitude, CultureInfo.InvariantCulture) - }; - - var locationService = ViewModelLocator.Resolve(); - await locationService.UpdateUserLocation(location, _settingsService.AuthAccessToken); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/Base/BindableBehavior.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/Base/BindableBehavior.cs deleted file mode 100644 index e3c2b67fa7..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/Base/BindableBehavior.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Behaviors.Base -{ - public class BindableBehavior : Behavior where T : BindableObject - { - public T AssociatedObject { get; private set; } - - protected override void OnAttachedTo(T visualElement) - { - base.OnAttachedTo(visualElement); - - AssociatedObject = visualElement; - - if (visualElement.BindingContext != null) - BindingContext = visualElement.BindingContext; - - visualElement.BindingContextChanged += OnBindingContextChanged; - } - - private void OnBindingContextChanged(object sender, EventArgs e) - { - OnBindingContextChanged(); - } - - protected override void OnDetachingFrom(T view) - { - view.BindingContextChanged -= OnBindingContextChanged; - } - - protected override void OnBindingContextChanged() - { - base.OnBindingContextChanged(); - BindingContext = AssociatedObject.BindingContext; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/EventToCommandBehavior.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/EventToCommandBehavior.cs deleted file mode 100644 index ee0aa89e30..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/EventToCommandBehavior.cs +++ /dev/null @@ -1,134 +0,0 @@ -using eShopOnContainers.Core.Behaviors.Base; -using System; -using System.Globalization; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Behaviors -{ - public class EventToCommandBehavior : BindableBehavior - { - public static BindableProperty EventNameProperty = - BindableProperty.CreateAttached("EventName", typeof(string), typeof(EventToCommandBehavior), null, - BindingMode.OneWay); - - public static BindableProperty CommandProperty = - BindableProperty.CreateAttached("Command", typeof(ICommand), typeof(EventToCommandBehavior), null, - BindingMode.OneWay); - - public static BindableProperty CommandParameterProperty = - BindableProperty.CreateAttached("CommandParameter", typeof(object), typeof(EventToCommandBehavior), null, - BindingMode.OneWay); - - public static BindableProperty EventArgsConverterProperty = - BindableProperty.CreateAttached("EventArgsConverter", typeof(IValueConverter), typeof(EventToCommandBehavior), null, - BindingMode.OneWay); - - public static BindableProperty EventArgsConverterParameterProperty = - BindableProperty.CreateAttached("EventArgsConverterParameter", typeof(object), typeof(EventToCommandBehavior), null, - BindingMode.OneWay); - - protected Delegate _handler; - private EventInfo _eventInfo; - - public string EventName - { - get { return (string)GetValue(EventNameProperty); } - set { SetValue(EventNameProperty, value); } - } - - public ICommand Command - { - get { return (ICommand)GetValue(CommandProperty); } - set { SetValue(CommandProperty, value); } - } - - public object CommandParameter - { - get { return GetValue(CommandParameterProperty); } - set { SetValue(CommandParameterProperty, value); } - } - - public IValueConverter EventArgsConverter - { - get { return (IValueConverter)GetValue(EventArgsConverterProperty); } - set { SetValue(EventArgsConverterProperty, value); } - } - - public object EventArgsConverterParameter - { - get { return GetValue(EventArgsConverterParameterProperty); } - set { SetValue(EventArgsConverterParameterProperty, value); } - } - - protected override void OnAttachedTo(View visualElement) - { - base.OnAttachedTo(visualElement); - - var events = AssociatedObject.GetType().GetRuntimeEvents().ToArray(); - if (events.Any()) - { - _eventInfo = events.FirstOrDefault(e => e.Name == EventName); - if (_eventInfo == null) - throw new ArgumentException(String.Format("EventToCommand: Can't find any event named '{0}' on attached type", EventName)); - - AddEventHandler(_eventInfo, AssociatedObject, OnFired); - } - } - - protected override void OnDetachingFrom(View view) - { - if (_handler != null) - _eventInfo.RemoveEventHandler(AssociatedObject, _handler); - - base.OnDetachingFrom(view); - } - - private void AddEventHandler(EventInfo eventInfo, object item, Action action) - { - var eventParameters = eventInfo.EventHandlerType - .GetRuntimeMethods().First(m => m.Name == "Invoke") - .GetParameters() - .Select(p => Expression.Parameter(p.ParameterType)) - .ToArray(); - - var actionInvoke = action.GetType() - .GetRuntimeMethods().First(m => m.Name == "Invoke"); - - _handler = Expression.Lambda( - eventInfo.EventHandlerType, - Expression.Call(Expression.Constant(action), actionInvoke, eventParameters[0], eventParameters[1]), - eventParameters - ) - .Compile(); - - eventInfo.AddEventHandler(item, _handler); - } - - private void OnFired(object sender, EventArgs eventArgs) - { - if (Command == null) - return; - - var parameter = CommandParameter; - - if (eventArgs != null && eventArgs != EventArgs.Empty) - { - parameter = eventArgs; - - if (EventArgsConverter != null) - { - parameter = EventArgsConverter.Convert(eventArgs, typeof(object), EventArgsConverterParameter, CultureInfo.CurrentUICulture); - } - } - - if (Command.CanExecute(parameter)) - { - Command.Execute(parameter); - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/LineColorBehavior.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/LineColorBehavior.cs deleted file mode 100644 index 1a4ee4a721..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Behaviors/LineColorBehavior.cs +++ /dev/null @@ -1,61 +0,0 @@ -using eShopOnContainers.Core.Effects; -using System.Linq; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Behaviors -{ - public static class LineColorBehavior - { - public static readonly BindableProperty ApplyLineColorProperty = - BindableProperty.CreateAttached("ApplyLineColor", typeof(bool), typeof(LineColorBehavior), false, - propertyChanged: OnApplyLineColorChanged); - - public static readonly BindableProperty LineColorProperty = - BindableProperty.CreateAttached("LineColor", typeof(Color), typeof(LineColorBehavior), Color.Default); - - public static bool GetApplyLineColor(BindableObject view) - { - return (bool)view.GetValue(ApplyLineColorProperty); - } - - public static void SetApplyLineColor(BindableObject view, bool value) - { - view.SetValue(ApplyLineColorProperty, value); - } - - public static Color GetLineColor(BindableObject view) - { - return (Color)view.GetValue(LineColorProperty); - } - - public static void SetLineColor(BindableObject view, Color value) - { - view.SetValue(LineColorProperty, value); - } - - private static void OnApplyLineColorChanged(BindableObject bindable, object oldValue, object newValue) - { - var view = bindable as View; - - if (view == null) - { - return; - } - - bool hasLine = (bool)newValue; - - if (hasLine) - { - view.Effects.Add(new EntryLineColorEffect()); - } - else - { - var entryLineColorEffectToRemove = view.Effects.FirstOrDefault(e => e is EntryLineColorEffect); - if (entryLineColorEffectToRemove != null) - { - view.Effects.Remove(entryLineColorEffectToRemove); - } - } - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml deleted file mode 100644 index 866cdbfb1d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml.cs deleted file mode 100644 index caa4839ac1..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/AddBasketButton.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Controls -{ - public partial class AddBasketButton : ContentView - { - public AddBasketButton() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/CustomTabbedPage.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/CustomTabbedPage.cs deleted file mode 100644 index 9fe24758d3..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/CustomTabbedPage.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Controls -{ - public class CustomTabbedPage : TabbedPage - { - public static BindableProperty BadgeTextProperty = - BindableProperty.CreateAttached("BadgeText", typeof(string), typeof(CustomTabbedPage), default(string), - BindingMode.OneWay); - - public static BindableProperty BadgeColorProperty = - BindableProperty.CreateAttached("BadgeColor", typeof(Color), typeof(CustomTabbedPage), Color.Default, - BindingMode.OneWay); - - public static string GetBadgeText(BindableObject view) - { - return (string)view.GetValue(BadgeTextProperty); - } - - public static void SetBadgeText(BindableObject view, string value) - { - view.SetValue(BadgeTextProperty, value); - } - - public static Color GetBadgeColor(BindableObject view) - { - return (Color)view.GetValue(BadgeColorProperty); - } - - public static void SetBadgeColor(BindableObject view, Color value) - { - view.SetValue(BadgeColorProperty, value); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/ToggleButton.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/ToggleButton.cs deleted file mode 100644 index 735a60fa95..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Controls/ToggleButton.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Controls -{ - public class ToggleButton : ContentView - { - public static readonly BindableProperty CommandProperty = - BindableProperty.Create("Command", typeof(ICommand), typeof(ToggleButton), null); - - public static readonly BindableProperty CommandParameterProperty = - BindableProperty.Create("CommandParameter", typeof(object), typeof(ToggleButton), null); - - public static readonly BindableProperty CheckedProperty = - BindableProperty.Create("Checked", typeof(bool), typeof(ToggleButton), false, BindingMode.TwoWay, - null, propertyChanged: OnCheckedChanged); - - public static readonly BindableProperty AnimateProperty = - BindableProperty.Create("Animate", typeof(bool), typeof(ToggleButton), false); - - public static readonly BindableProperty CheckedImageProperty = - BindableProperty.Create("CheckedImage", typeof(ImageSource), typeof(ToggleButton), null); - - public static readonly BindableProperty UnCheckedImageProperty = - BindableProperty.Create("UnCheckedImage", typeof(ImageSource), typeof(ToggleButton), null); - - private ICommand _toggleCommand; - private Image _toggleImage; - - public ToggleButton() - { - Initialize(); - } - - public ICommand Command - { - get { return (ICommand)GetValue(CommandProperty); } - set { SetValue(CommandProperty, value); } - } - - public object CommandParameter - { - get { return GetValue(CommandParameterProperty); } - set { SetValue(CommandParameterProperty, value); } - } - - public bool Checked - { - get { return (bool)GetValue(CheckedProperty); } - set { SetValue(CheckedProperty, value); } - } - - public bool Animate - { - get { return (bool)GetValue(AnimateProperty); } - set { SetValue(CheckedProperty, value); } - } - - public ImageSource CheckedImage - { - get { return (ImageSource)GetValue(CheckedImageProperty); } - set { SetValue(CheckedImageProperty, value); } - } - - public ImageSource UnCheckedImage - { - get { return (ImageSource)GetValue(UnCheckedImageProperty); } - set { SetValue(UnCheckedImageProperty, value); } - } - - public ICommand ToogleCommand - { - get - { - return _toggleCommand - ?? (_toggleCommand = new Command(() => - { - if (Checked) - { - Checked = false; - } - else - { - Checked = true; - } - - if (Command != null) - { - Command.Execute(CommandParameter); - } - })); - } - } - - private void Initialize() - { - _toggleImage = new Image(); - - Animate = true; - - GestureRecognizers.Add(new TapGestureRecognizer - { - Command = ToogleCommand - }); - - _toggleImage.Source = UnCheckedImage; - Content = _toggleImage; - } - - protected override void OnParentSet() - { - base.OnParentSet(); - _toggleImage.Source = UnCheckedImage; - Content = _toggleImage; - } - - private static async void OnCheckedChanged(BindableObject bindable, object oldValue, object newValue) - { - var toggleButton = (ToggleButton)bindable; - - if (Equals(newValue, null) && !Equals(oldValue, null)) - return; - - if (toggleButton.Checked) - { - toggleButton._toggleImage.Source = toggleButton.CheckedImage; - } - else - { - toggleButton._toggleImage.Source = toggleButton.UnCheckedImage; - } - - toggleButton.Content = toggleButton._toggleImage; - - if (toggleButton.Animate) - { - await toggleButton.ScaleTo(0.9, 50, Easing.Linear); - await Task.Delay(100); - await toggleButton.ScaleTo(1, 50, Easing.Linear); - } - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/CountToBoolConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/CountToBoolConverter.cs deleted file mode 100644 index 60adb407d0..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/CountToBoolConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class CountToBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is int) - { - int count = System.Convert.ToInt32(value); - - return count > 0; - } - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DatetimeConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DatetimeConverter.cs deleted file mode 100644 index 175ccd1320..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DatetimeConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class DatetimeConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if(value is DateTime) - { - var date = (DateTime)value; - - return date.ToString("MMMM dd yyyy").ToUpper(); - } - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DoubleConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DoubleConverter.cs deleted file mode 100644 index dcb54df4ec..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/DoubleConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class DoubleConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is double) - return value.ToString(); - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - double doub; - if (double.TryParse(value as string, out doub)) - return doub; - return value; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/FirstValidationErrorConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/FirstValidationErrorConverter.cs deleted file mode 100644 index d7f2f35440..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/FirstValidationErrorConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class FirstValidationErrorConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - ICollection errors = value as ICollection; - return errors != null && errors.Count > 0 ? errors.ElementAt(0) : null; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ImageConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ImageConverter.cs deleted file mode 100644 index 289d3b0a1f..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ImageConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class ImageConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) - return string.Empty; - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs deleted file mode 100644 index 622c85d855..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseBoolConverter.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class InverseBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (!(value is bool)) - { - throw new InvalidOperationException("The target must be a boolean"); - } - - return !(bool)value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseCountToBoolConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseCountToBoolConverter.cs deleted file mode 100644 index 6f892a1c5d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/InverseCountToBoolConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class InverseCountToBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is int) - { - int count = System.Convert.ToInt32(value); - - return count == 0; - } - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemTappedEventArgsConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemTappedEventArgsConverter.cs deleted file mode 100644 index 7b9f79b8e8..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemTappedEventArgsConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class ItemTappedEventArgsConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var eventArgs = value as ItemTappedEventArgs; - if (eventArgs == null) - throw new ArgumentException("Expected TappedEventArgs as value", "value"); - - return eventArgs.Item; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemsToHeightConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemsToHeightConverter.cs deleted file mode 100644 index 419ca50827..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ItemsToHeightConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class ItemsToHeightConverter : IValueConverter - { - private const int ItemHeight = 156; - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if(value is int) - { - return System.Convert.ToInt32(value) * ItemHeight; - } - - return 0; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/StringNullOrEmptyBoolConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/StringNullOrEmptyBoolConverter.cs deleted file mode 100644 index eb7b12e10b..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/StringNullOrEmptyBoolConverter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class StringNullOrEmptyBoolConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var stringValue = value as string; - - return !string.IsNullOrEmpty(stringValue); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return null; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ToUpperConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ToUpperConverter.cs deleted file mode 100644 index 451ee37aa2..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/ToUpperConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class ToUpperConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null) - return value.ToString().ToUpperInvariant(); - else - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatedEventArgsConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatedEventArgsConverter.cs deleted file mode 100644 index 9c25b3b87d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatedEventArgsConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class WebNavigatedEventArgsConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var eventArgs = value as WebNavigatedEventArgs; - if (eventArgs == null) - throw new ArgumentException("Expected WebNavigatedEventArgs as value", "value"); - - return eventArgs.Url; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatingEventArgsConverter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatingEventArgsConverter.cs deleted file mode 100644 index 015afef259..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Converters/WebNavigatingEventArgsConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Globalization; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Converters -{ - public class WebNavigatingEventArgsConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var eventArgs = value as WebNavigatingEventArgs; - if (eventArgs == null) - throw new ArgumentException("Expected WebNavigatingEventArgs as value", "value"); - - return eventArgs.Url; - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/EntryLineColorEffect.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/EntryLineColorEffect.cs deleted file mode 100644 index a58129775b..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/EntryLineColorEffect.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Effects -{ - public class EntryLineColorEffect : RoutingEffect - { - public EntryLineColorEffect() : base("eShopOnContainers.EntryLineColorEffect") - { - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/ThemeEffects.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/ThemeEffects.cs deleted file mode 100644 index 72b5796843..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Effects/ThemeEffects.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Effects -{ - public static class ThemeEffects - { - public static readonly BindableProperty CircleProperty = - BindableProperty.CreateAttached("Circle", typeof(bool), typeof(ThemeEffects), false, propertyChanged: OnChanged); - - public static bool GetCircle(BindableObject view) - { - return (bool)view.GetValue(CircleProperty); - } - - public static void SetCircle(BindableObject view, bool circle) - { - view.SetValue(CircleProperty, circle); - } - - - private static void OnChanged(BindableObject bindable, object oldValue, object newValue) - where TEffect : Effect, new() - { - var view = bindable as View; - if (view == null) - { - return; - } - - if (EqualityComparer.Equals(newValue, default(TProp))) - { - var toRemove = view.Effects.FirstOrDefault(e => e is TEffect); - if (toRemove != null) - { - view.Effects.Remove(toRemove); - } - } - else - { - view.Effects.Add(new TEffect()); - } - } - - private class CircleEffect : RoutingEffect - { - public CircleEffect() - : base("eShopOnContainers.CircleEffect") - { - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Exceptions/ServiceAuthenticationException.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Exceptions/ServiceAuthenticationException.cs deleted file mode 100644 index d07d016a28..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Exceptions/ServiceAuthenticationException.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Exceptions -{ - public class ServiceAuthenticationException : Exception - { - public string Content { get; } - - public ServiceAuthenticationException() - { - } - - public ServiceAuthenticationException(string content) - { - Content = content; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs deleted file mode 100644 index 800f9a0318..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Extensions/ObservableExtension.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; - -namespace eShopOnContainers.Core.Extensions -{ - public static class ObservableExtension - { - public static ObservableCollection ToObservableCollection(this IEnumerable source) - { - ObservableCollection collection = new ObservableCollection(); - - foreach (T item in source) - { - collection.Add(item); - } - - return collection; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs deleted file mode 100644 index 61fc7da420..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/GlobalSettings.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; - -namespace eShopOnContainers.Core -{ - public class GlobalSetting - { - public const string AzureTag = "Azure"; - public const string MockTag = "Mock"; - public const string DefaultEndpoint = "http://YOUR_IP_OR_DNS_NAME"; // i.e.: "http://YOUR_IP" or "http://YOUR_DNS_NAME" - - private string _baseIdentityEndpoint; - private string _baseGatewayShoppingEndpoint; - private string _baseGatewayMarketingEndpoint; - - public GlobalSetting() - { - AuthToken = "INSERT AUTHENTICATION TOKEN"; - - BaseIdentityEndpoint = DefaultEndpoint; - BaseGatewayShoppingEndpoint = DefaultEndpoint; - BaseGatewayMarketingEndpoint = DefaultEndpoint; - } - - public static GlobalSetting Instance { get; } = new GlobalSetting(); - - public string BaseIdentityEndpoint - { - get { return _baseIdentityEndpoint; } - set - { - _baseIdentityEndpoint = value; - UpdateEndpoint(_baseIdentityEndpoint); - } - } - - public string BaseGatewayShoppingEndpoint - { - get { return _baseGatewayShoppingEndpoint; } - set - { - _baseGatewayShoppingEndpoint = value; - UpdateGatewayShoppingEndpoint(_baseGatewayShoppingEndpoint); - } - } - - public string BaseGatewayMarketingEndpoint - { - get { return _baseGatewayMarketingEndpoint; } - set - { - _baseGatewayMarketingEndpoint = value; - UpdateGatewayMarketingEndpoint(_baseGatewayMarketingEndpoint); - } - } - - public string ClientId { get { return "xamarin"; } } - - public string ClientSecret { get { return "secret"; } } - - public string AuthToken { get; set; } - - public string RegisterWebsite { get; set; } - - public string AuthorizeEndpoint { get; set; } - - public string UserInfoEndpoint { get; set; } - - public string TokenEndpoint { get; set; } - - public string LogoutEndpoint { get; set; } - - public string Callback { get; set; } - - public string LogoutCallback { get; set; } - - public string GatewayShoppingEndpoint { get; set; } - - public string GatewayMarketingEndpoint { get; set; } - - private void UpdateEndpoint(string endpoint) - { - RegisterWebsite = $"{endpoint}/Account/Register"; - LogoutCallback = $"{endpoint}/Account/Redirecting"; - - var connectBaseEndpoint = $"{endpoint}/connect"; - AuthorizeEndpoint = $"{connectBaseEndpoint}/authorize"; - UserInfoEndpoint = $"{connectBaseEndpoint}/userinfo"; - TokenEndpoint = $"{connectBaseEndpoint}/token"; - LogoutEndpoint = $"{connectBaseEndpoint}/endsession"; - - var baseUri = ExtractBaseUri(endpoint); - Callback = $"{baseUri}/xamarincallback"; - } - - private void UpdateGatewayShoppingEndpoint(string endpoint) - { - GatewayShoppingEndpoint = $"{endpoint}"; - } - - private void UpdateGatewayMarketingEndpoint(string endpoint) - { - GatewayMarketingEndpoint = $"{endpoint}"; - } - - private string ExtractBaseUri(string endpoint) - { - var uri = new Uri(endpoint); - var baseUri = uri.GetLeftPart(System.UriPartial.Authority); - - return baseUri; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/EasingHelper.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/EasingHelper.cs deleted file mode 100644 index b2ba7c7620..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/EasingHelper.cs +++ /dev/null @@ -1,39 +0,0 @@ -using eShopOnContainers.Core.Animations.Base; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Helpers -{ - public static class EasingHelper - { - public static Easing GetEasing(EasingType type) - { - switch (type) - { - case EasingType.BounceIn: - return Easing.BounceIn; - case EasingType.BounceOut: - return Easing.BounceOut; - case EasingType.CubicIn: - return Easing.CubicIn; - case EasingType.CubicInOut: - return Easing.CubicInOut; - case EasingType.CubicOut: - return Easing.CubicOut; - case EasingType.Linear: - return Easing.Linear; - case EasingType.SinIn: - return Easing.SinIn; - case EasingType.SinInOut: - return Easing.SinInOut; - case EasingType.SinOut: - return Easing.SinOut; - case EasingType.SpringIn: - return Easing.SpringIn; - case EasingType.SpringOut: - return Easing.SpringOut; - } - - return null; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/RandomNumberGenerator.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/RandomNumberGenerator.cs deleted file mode 100644 index cfad4d1ce4..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/RandomNumberGenerator.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text; - -namespace eShopOnContainers.Core.Helpers -{ - internal static class RandomNumberGenerator - { - public static string CreateUniqueId(int length = 64) - { - var bytes = PCLCrypto.WinRTCrypto.CryptographicBuffer.GenerateRandom(length); - return ByteArrayToString(bytes); - } - - private static string ByteArrayToString(byte[] array) - { - var hex = new StringBuilder(array.Length * 2); - foreach (byte b in array) - { - hex.AppendFormat("{0:x2}", b); - } - return hex.ToString(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/UriHelper.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/UriHelper.cs deleted file mode 100644 index 0aef68db54..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Helpers/UriHelper.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace eShopOnContainers.Core.Helpers -{ - public static class UriHelper - { - public static string CombineUri(params string[] uriParts) - { - string uri = string.Empty; - if (uriParts != null && uriParts.Count() > 0) - { - char[] trims = new char[] { '\\', '/' }; - uri = (uriParts[0] ?? string.Empty).TrimEnd(trims); - for (int i = 1; i < uriParts.Count(); i++) - { - uri = string.Format("{0}/{1}", uri.TrimEnd(trims), (uriParts[i] ?? string.Empty).TrimStart(trims)); - } - } - return uri; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketCheckout.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketCheckout.cs deleted file mode 100644 index e6b7aaea6d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketCheckout.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace eShopOnContainers.Core.Models.Basket -{ - public class BasketCheckout - { - [Required] - public string City { get; set; } - [Required] - public string Street { get; set; } - [Required] - public string State { get; set; } - [Required] - public string Country { get; set; } - - public string ZipCode { get; set; } - [Required] - public string CardNumber { get; set; } - [Required] - public string CardHolderName { get; set; } - - [Required] - public DateTime CardExpiration { get; set; } - - [Required] - public string CardSecurityNumber { get; set; } - - public int CardTypeId { get; set; } - - public string Buyer { get; set; } - - [Required] - public Guid RequestId { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs deleted file mode 100644 index b9d8758efd..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Models.Basket -{ - public class BasketItem : BindableObject - { - private int _quantity; - - public string Id { get; set; } - - public string ProductId { get; set; } - - public string ProductName { get; set; } - - public decimal UnitPrice { get; set; } - - public decimal OldUnitPrice { get; set; } - - public bool HasNewPrice - { - get - { - return OldUnitPrice != 0.0m; - } - } - - public int Quantity - { - get { return _quantity; } - set - { - _quantity = value; - OnPropertyChanged("Quantity"); - } - } - - public string PictureUrl { get; set; } - - public decimal Total { get { return Quantity * UnitPrice; } } - - public override string ToString() - { - return String.Format("Product Id: {0}, Quantity: {1}", ProductId, Quantity); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/CustomerBasket.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/CustomerBasket.cs deleted file mode 100644 index 66afa7f9af..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/CustomerBasket.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace eShopOnContainers.Core.Models.Basket -{ - public class CustomerBasket - { - public string BuyerId { get; set; } - public List Items { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs deleted file mode 100644 index 504031c1be..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogBrand.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace eShopOnContainers.Core.Models.Catalog -{ - public class CatalogBrand - { - public int Id { get; set; } - public string Brand { get; set; } - - public override string ToString() - { - return Brand; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs deleted file mode 100644 index 649afa0083..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogItem.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace eShopOnContainers.Core.Models.Catalog -{ - public class CatalogItem - { - public string Id { get; set; } - public string Name { get; set; } - public string Description { get; set; } - public decimal Price { get; set; } - public string PictureUri { get; set; } - public int CatalogBrandId { get; set; } - public string CatalogBrand { get; set; } - public int CatalogTypeId { get; set; } - public string CatalogType { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogRoot.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogRoot.cs deleted file mode 100644 index eef40f88b9..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogRoot.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace eShopOnContainers.Core.Models.Catalog -{ - public class CatalogRoot - { - public int PageIndex { get; set; } - public int PageSize { get; set; } - public int Count { get; set; } - public List Data { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs deleted file mode 100644 index c12b170072..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Catalog/CatalogType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace eShopOnContainers.Core.Models.Catalog -{ - public class CatalogType - { - public int Id { get; set; } - public string Type { get; set; } - - public override string ToString() - { - return Type; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationError.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationError.cs deleted file mode 100644 index d8ac111841..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationError.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace eShopOnContainers.Core.Models.Location -{ - public enum GeolocationError - { - PositionUnavailable, - Unauthorized - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationException.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationException.cs deleted file mode 100644 index 39b89483af..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/GeolocationException.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Models.Location -{ - public class GeolocationException : Exception - { - public GeolocationError Error { get; private set; } - - public GeolocationException(GeolocationError error) - : base("A geolocation error occured: " + error) - { - if (!Enum.IsDefined(typeof(GeolocationError), error)) - throw new ArgumentException("error is not a valid GelocationError member", "error"); - - Error = error; - } - - public GeolocationException(GeolocationError error, Exception innerException) - : base("A geolocation error occured: " + error, innerException) - { - if (!Enum.IsDefined(typeof(GeolocationError), error)) - throw new ArgumentException("error is not a valid GelocationError member", "error"); - - Error = error; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Location.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Location.cs deleted file mode 100644 index 21a50c2755..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Location.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace eShopOnContainers.Core.Models.Location -{ - public class Location - { - public double Longitude { get; set; } - public double Latitude { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Position.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Position.cs deleted file mode 100644 index fab7ed7325..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Location/Position.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Models.Location -{ - public class Position - { - public DateTimeOffset Timestamp { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public double Altitude { get; set; } - public double Accuracy { get; set; } - public double AltitudeAccuracy { get; set; } - public double Heading { get; set; } - public double Speed { get; set; } - - public Position() - { - } - - public Position(double latitude, double longitude) - { - - Timestamp = DateTimeOffset.UtcNow; - Latitude = latitude; - Longitude = longitude; - } - - public Position(Position position) - { - if (position == null) - throw new ArgumentNullException("position"); - - Timestamp = position.Timestamp; - Latitude = position.Latitude; - Longitude = position.Longitude; - Altitude = position.Altitude; - AltitudeAccuracy = position.AltitudeAccuracy; - Accuracy = position.Accuracy; - Heading = position.Heading; - Speed = position.Speed; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/Campaign.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/Campaign.cs deleted file mode 100644 index 29c53264b4..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/Campaign.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Models.Marketing -{ - public class Campaign - { - public int Id { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public DateTime From { get; set; } - - public DateTime To { get; set; } - - public string PictureUri { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignItem.cs deleted file mode 100644 index c60c97fb25..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Models.Marketing -{ - public class CampaignItem - { - public int Id { get; set; } - - public string Name { get; set; } - - public string Description { get; set; } - - public DateTime From { get; set; } - - public DateTime To { get; set; } - - public string PictureUri { get; set; } - - public string DetailsUri { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignRoot.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignRoot.cs deleted file mode 100644 index 70573dccca..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Marketing/CampaignRoot.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace eShopOnContainers.Core.Models.Marketing -{ - public class CampaignRoot - { - public int PageIndex { get; set; } - public int PageSize { get; set; } - public int Count { get; set; } - public List Data { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs deleted file mode 100644 index 8fbf2b495d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Navigation/TabParameter.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace eShopOnContainers.Core.Models.Navigation -{ - public class TabParameter - { - public int TabIndex { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CancelOrderCommand.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CancelOrderCommand.cs deleted file mode 100644 index 62b1e29fc7..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CancelOrderCommand.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace eShopOnContainers.Core.Models.Orders -{ - public class CancelOrderCommand - { - public int OrderNumber { get; } - - public CancelOrderCommand(int orderNumber) - { - OrderNumber = orderNumber; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CardType.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CardType.cs deleted file mode 100644 index 07873e79c4..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/CardType.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace eShopOnContainers.Core.Models.Orders -{ - public class CardType - { - public int Id { get; set; } - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs deleted file mode 100644 index 0232e70ad3..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/Order.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace eShopOnContainers.Core.Models.Orders -{ - public class Order - { - public Order() - { - SequenceNumber = 1; - OrderItems = new List(); - } - - public string BuyerId { get; set; } - - public int SequenceNumber { get; set; } - - [JsonProperty("date")] - public DateTime OrderDate { get; set; } - - [JsonProperty("status")] - public OrderStatus OrderStatus { get; set; } - - [JsonProperty("city")] - public string ShippingCity { get; set; } - - [JsonProperty("street")] - public string ShippingStreet { get; set; } - - [JsonProperty("state")] - public string ShippingState { get; set; } - - [JsonProperty("country")] - public string ShippingCountry { get; set; } - - [JsonProperty("zipCode")] - public string ShippingZipCode { get; set; } - - public int CardTypeId { get; set; } - - public string CardNumber { get; set; } - - public string CardHolderName { get; set; } - - public DateTime CardExpiration { get; set; } - - public string CardSecurityNumber { get; set; } - - [JsonProperty("orderitems")] - public List OrderItems { get; set; } - - [JsonProperty("total")] - public decimal Total { get; set; } - - [JsonProperty("ordernumber")] - public int OrderNumber { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs deleted file mode 100644 index 8732a59f4f..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Newtonsoft.Json; -using System; - -namespace eShopOnContainers.Core.Models.Orders -{ - public class OrderItem - { - public string ProductId { get; set; } - public Guid? OrderId { get; set; } - - [JsonProperty("unitprice")] - public decimal UnitPrice { get; set; } - - [JsonProperty("productname")] - public string ProductName { get; set; } - - [JsonProperty("pictureurl")] - public string PictureUrl { get; set; } - - [JsonProperty("units")] - public int Quantity { get; set; } - - public decimal Discount { get; set; } - public decimal Total { get { return Quantity * UnitPrice; } } - - public override string ToString() - { - return String.Format("Product Id: {0}, Quantity: {1}", ProductId, Quantity); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderStatus.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderStatus.cs deleted file mode 100644 index 491fb93b79..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderStatus.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace eShopOnContainers.Core.Models.Orders -{ - public enum OrderStatus - { - Submitted, - AwaitingValidation, - StockConfirmed, - Paid, - Shipped, - Cancelled - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/Permission.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/Permission.cs deleted file mode 100644 index bee5de4245..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/Permission.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace eShopOnContainers.Core.Models.Permissions -{ - public enum Permission - { - Unknown, - Location, - LocationAlways, - LocationWhenInUse - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/PermissionStatus.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/PermissionStatus.cs deleted file mode 100644 index 2a8f789f63..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Permissions/PermissionStatus.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace eShopOnContainers.Core.Models.Permissions -{ - public enum PermissionStatus - { - Denied, - Disabled, - Granted, - Restricted, - Unknown - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Token/UserToken.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Token/UserToken.cs deleted file mode 100644 index 1e7d2f5613..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Token/UserToken.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Newtonsoft.Json; - -namespace eShopOnContainers.Core.Models.Token -{ - public class UserToken - { - [JsonProperty("id_token")] - public string IdToken { get; set; } - - [JsonProperty("access_token")] - public string AccessToken { get; set; } - - [JsonProperty("expires_in")] - public int ExpiresIn { get; set; } - - [JsonProperty("token_type")] - public string TokenType { get; set; } - - [JsonProperty("refresh_token")] - public string RefreshToken { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/Address.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/Address.cs deleted file mode 100644 index c690b56717..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/Address.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace eShopOnContainers.Core.Models.User -{ - public class Address - { - public Guid Id { get; set; } - public string Street { get; set; } - public string City { get; set; } - public string State { get; set; } - public string StateCode { get; set; } - public string Country { get; set; } - public string CountryCode { get; set; } - public string ZipCode { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/LogoutParameter.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/LogoutParameter.cs deleted file mode 100644 index a338c44bbb..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/LogoutParameter.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace eShopOnContainers.Core.Models.User -{ - public class LogoutParameter - { - public bool Logout { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/PaymentInfo.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/PaymentInfo.cs deleted file mode 100644 index fc38a78564..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/PaymentInfo.cs +++ /dev/null @@ -1,17 +0,0 @@ -using eShopOnContainers.Core.Models.Orders; -using System; - -namespace eShopOnContainers.Core.Models.User -{ - public class PaymentInfo - { - public Guid Id { get; set; } - public string CardNumber { get; set; } - public string SecurityNumber { get; set; } - public int ExpirationMonth { get; set; } - public int ExpirationYear { get; set; } - public string CardHolderName { get; set; } - public CardType CardType { get; set; } - public string Expiration { get; set; } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/UserInfo.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/UserInfo.cs deleted file mode 100644 index 4b70e36e2b..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/User/UserInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Newtonsoft.Json; - -namespace eShopOnContainers.Core.Models.User -{ - public class UserInfo - { - [JsonProperty("sub")] - public string UserId { get; set; } - - [JsonProperty("preferred_username")] - public string PreferredUsername { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("last_name")] - public string LastName { get; set; } - - [JsonProperty("card_number")] - public string CardNumber { get; set; } - - [JsonProperty("card_holder")] - public string CardHolder { get; set; } - - [JsonProperty("card_security_number")] - public string CardSecurityNumber { get; set; } - - [JsonProperty("address_city")] - public string Address { get; set; } - - [JsonProperty("address_country")] - public string Country { get; set; } - - [JsonProperty("address_state")] - public string State { get; set; } - - [JsonProperty("address_street")] - public string Street { get; set; } - - [JsonProperty("address_zip_code")] - public string ZipCode { get; set; } - - [JsonProperty("email")] - public string Email { get; set; } - - [JsonProperty("email_verified")] - public bool EmailVerified { get; set; } - - [JsonProperty("phone_number")] - public string PhoneNumber { get; set; } - - [JsonProperty("phone_number_verified")] - public bool PhoneNumberVerified { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs deleted file mode 100644 index 8c54a89932..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs +++ /dev/null @@ -1,77 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using System.Collections.Generic; -using System.Threading.Tasks; -using Xamarin.Forms; -using System; - -namespace eShopOnContainers.Core.Services.Basket -{ - public class BasketMockService : IBasketService - { - private CustomerBasket MockCustomBasket = new CustomerBasket - { - BuyerId = "9245fe4a-d402-451c-b9ed-9c1a04247482", - Items = new List - { - new BasketItem { Id = "1", PictureUrl = Device.RuntimePlatform != Device.UWP ? "fake_product_01.png" : "Assets/fake_product_01.png", ProductId = Common.Common.MockCatalogItemId01, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 19.50M }, - new BasketItem { Id = "2", PictureUrl = Device.RuntimePlatform != Device.UWP ? "fake_product_04.png" : "Assets/fake_product_04.png", ProductId = Common.Common.MockCatalogItemId04, ProductName = ".NET Black Cupt", Quantity = 1, UnitPrice = 17.00M } - } - }; - - public async Task GetBasketAsync(string guidUser, string token) - { - await Task.Delay(10); - - if (string.IsNullOrEmpty(guidUser) || string.IsNullOrEmpty(token)) - { - return new CustomerBasket(); - } - - return MockCustomBasket; - } - - public async Task UpdateBasketAsync(CustomerBasket customerBasket, string token) - { - await Task.Delay(10); - - if (string.IsNullOrEmpty(token)) - { - return new CustomerBasket(); - } - - MockCustomBasket = customerBasket; - - return MockCustomBasket; - } - - public async Task ClearBasketAsync(string guidUser, string token) - { - await Task.Delay(10); - - if (string.IsNullOrEmpty(token)) - { - return; - } - - if (!string.IsNullOrEmpty(guidUser)) - { - MockCustomBasket.Items.Clear(); - } - } - - public Task CheckoutAsync(BasketCheckout basketCheckout, string token) - { - if (string.IsNullOrEmpty(token)) - { - return Task.FromResult(0); - } - - if (basketCheckout != null) - { - MockCustomBasket.Items.Clear(); - } - - return Task.FromResult(0); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketService.cs deleted file mode 100644 index 48814341be..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketService.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Threading.Tasks; -using eShopOnContainers.Core.Services.RequestProvider; -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Services.FixUri; -using eShopOnContainers.Core.Helpers; - -namespace eShopOnContainers.Core.Services.Basket -{ - public class BasketService : IBasketService - { - private readonly IRequestProvider _requestProvider; - private readonly IFixUriService _fixUriService; - - private const string ApiUrlBase = "api/v1/b/basket"; - - public BasketService(IRequestProvider requestProvider, IFixUriService fixUriService) - { - _requestProvider = requestProvider; - _fixUriService = fixUriService; - } - - public async Task GetBasketAsync(string guidUser, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/{guidUser}"); - - CustomerBasket basket; - - try - { - basket = await _requestProvider.GetAsync(uri, token); - } - catch (HttpRequestExceptionEx exception) when (exception.HttpCode == System.Net.HttpStatusCode.NotFound) - { - basket = null; - } - - _fixUriService.FixBasketItemPictureUri(basket?.Items); - return basket; - } - - public async Task UpdateBasketAsync(CustomerBasket customerBasket, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, ApiUrlBase); - - var result = await _requestProvider.PostAsync(uri, customerBasket, token); - return result; - } - - public async Task CheckoutAsync(BasketCheckout basketCheckout, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/checkout"); - - await _requestProvider.PostAsync(uri, basketCheckout, token); - } - - public async Task ClearBasketAsync(string guidUser, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/{guidUser}"); - - await _requestProvider.DeleteAsync(uri, token); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/IBasketService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/IBasketService.cs deleted file mode 100644 index f77080e6d7..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/IBasketService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Basket -{ - public interface IBasketService - { - Task GetBasketAsync(string guidUser, string token); - Task UpdateBasketAsync(CustomerBasket customerBasket, string token); - Task CheckoutAsync(BasketCheckout basketCheckout, string token); - Task ClearBasketAsync(string guidUser, string token); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs deleted file mode 100644 index db6aee837f..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs +++ /dev/null @@ -1,65 +0,0 @@ -using eShopOnContainers.Core.Extensions; -using eShopOnContainers.Core.Models.Catalog; -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Services.Catalog -{ - public class CatalogMockService : ICatalogService - { - private ObservableCollection MockCatalogBrand = new ObservableCollection - { - new CatalogBrand { Id = 1, Brand = "Azure" }, - new CatalogBrand { Id = 2, Brand = "Visual Studio" } - }; - - private ObservableCollection MockCatalogType = new ObservableCollection - { - new CatalogType { Id = 1, Type = "Mug" }, - new CatalogType { Id = 2, Type = "T-Shirt" } - }; - - private ObservableCollection MockCatalog = new ObservableCollection - { - new CatalogItem { Id = Common.Common.MockCatalogItemId01, PictureUri = Device.RuntimePlatform != Device.UWP ? "fake_product_01.png" : "Assets/fake_product_01.png", Name = ".NET Bot Blue Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" }, - new CatalogItem { Id = Common.Common.MockCatalogItemId02, PictureUri = Device.RuntimePlatform != Device.UWP ? "fake_product_02.png" : "Assets/fake_product_02.png", Name = ".NET Bot Purple Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" }, - new CatalogItem { Id = Common.Common.MockCatalogItemId03, PictureUri = Device.RuntimePlatform != Device.UWP ? "fake_product_03.png" : "Assets/fake_product_03.png", Name = ".NET Bot Black Sweatshirt (M)", Price = 19.95M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 2, CatalogType = "T-Shirt" }, - new CatalogItem { Id = Common.Common.MockCatalogItemId04, PictureUri = Device.RuntimePlatform != Device.UWP ? "fake_product_04.png" : "Assets/fake_product_04.png", Name = ".NET Black Cupt", Price = 17.00M, CatalogBrandId = 2, CatalogBrand = "Visual Studio", CatalogTypeId = 1, CatalogType = "Mug" }, - new CatalogItem { Id = Common.Common.MockCatalogItemId05, PictureUri = Device.RuntimePlatform != Device.UWP ? "fake_product_05.png" : "Assets/fake_product_05.png", Name = "Azure Black Sweatshirt (M)", Price = 19.50M, CatalogBrandId = 1, CatalogBrand = "Azure", CatalogTypeId = 2, CatalogType = "T-Shirt" } - }; - - public async Task> GetCatalogAsync() - { - await Task.Delay(10); - - return MockCatalog; - } - - public async Task> FilterAsync(int catalogBrandId, int catalogTypeId) - { - await Task.Delay(10); - - return MockCatalog - .Where(c => c.CatalogBrandId == catalogBrandId && - c.CatalogTypeId == catalogTypeId) - .ToObservableCollection(); - } - - public async Task> GetCatalogBrandAsync() - { - await Task.Delay(10); - - return MockCatalogBrand; - } - - public async Task> GetCatalogTypeAsync() - { - await Task.Delay(10); - - return MockCatalogType; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs deleted file mode 100644 index a13c22cb89..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogService.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Threading.Tasks; -using eShopOnContainers.Core.Models.Catalog; -using eShopOnContainers.Core.Services.RequestProvider; -using eShopOnContainers.Core.Extensions; -using System.Collections.Generic; -using eShopOnContainers.Core.Services.FixUri; -using eShopOnContainers.Core.Helpers; - -namespace eShopOnContainers.Core.Services.Catalog -{ - public class CatalogService : ICatalogService - { - private readonly IRequestProvider _requestProvider; - private readonly IFixUriService _fixUriService; - - private const string ApiUrlBase = "api/v1/c/catalog"; - - public CatalogService(IRequestProvider requestProvider, IFixUriService fixUriService) - { - _requestProvider = requestProvider; - _fixUriService = fixUriService; - } - - public async Task> FilterAsync(int catalogBrandId, int catalogTypeId) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/items/type/{catalogTypeId}/brand/{catalogBrandId}"); - - CatalogRoot catalog = await _requestProvider.GetAsync(uri); - - if (catalog?.Data != null) - return catalog?.Data.ToObservableCollection(); - else - return new ObservableCollection(); - } - - public async Task> GetCatalogAsync() - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/items"); - - CatalogRoot catalog = await _requestProvider.GetAsync(uri); - - if (catalog?.Data != null) - { - _fixUriService.FixCatalogItemPictureUri(catalog?.Data); - return catalog?.Data.ToObservableCollection(); - } - else - return new ObservableCollection(); - } - - public async Task> GetCatalogBrandAsync() - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/catalogbrands"); - - IEnumerable brands = await _requestProvider.GetAsync>(uri); - - if (brands != null) - return brands?.ToObservableCollection(); - else - return new ObservableCollection(); - } - - public async Task> GetCatalogTypeAsync() - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/catalogtypes"); - - IEnumerable types = await _requestProvider.GetAsync>(uri); - - if (types != null) - return types.ToObservableCollection(); - else - return new ObservableCollection(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs deleted file mode 100644 index 74d6aa91b2..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/ICatalogService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using eShopOnContainers.Core.Models.Catalog; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Catalog -{ - public interface ICatalogService - { - Task> GetCatalogBrandAsync(); - Task> FilterAsync(int catalogBrandId, int catalogTypeId); - Task> GetCatalogTypeAsync(); - Task> GetCatalogAsync(); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Common/Common.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Common/Common.cs deleted file mode 100644 index 93394f7a44..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Common/Common.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace eShopOnContainers.Core.Services.Common -{ - public static class Common - { - public static string MockCatalogItemId01 = "1"; - public static string MockCatalogItemId02 = "2"; - public static string MockCatalogItemId03 = "3"; - public static string MockCatalogItemId04 = "4"; - public static string MockCatalogItemId05 = "5"; - - public static int MockCampaignId01 = 1; - public static int MockCampaignId02 = 2; - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/DependencyService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/DependencyService.cs deleted file mode 100644 index 3076c85726..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/DependencyService.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace eShopOnContainers.Core.Services.Dependency -{ - public class DependencyService : IDependencyService - { - public T Get() where T : class - { - return Xamarin.Forms.DependencyService.Get(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/IDependencyService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/IDependencyService.cs deleted file mode 100644 index 53c2ccb4ed..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dependency/IDependencyService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace eShopOnContainers.Core.Services.Dependency -{ - public interface IDependencyService - { - T Get() where T : class; - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/DialogService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/DialogService.cs deleted file mode 100644 index 7c731c9c15..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/DialogService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Acr.UserDialogs; -using System.Threading.Tasks; - -namespace eShopOnContainers.Services -{ - public class DialogService : IDialogService - { - public Task ShowAlertAsync(string message, string title, string buttonLabel) - { - return UserDialogs.Instance.AlertAsync(message, title, buttonLabel); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/IDialogService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/IDialogService.cs deleted file mode 100644 index aaf3785e17..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Dialog/IDialogService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; - -namespace eShopOnContainers.Services -{ - public interface IDialogService - { - Task ShowAlertAsync(string message, string title, string buttonLabel); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/FixUriService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/FixUriService.cs deleted file mode 100644 index c774cec55b..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/FixUriService.cs +++ /dev/null @@ -1,122 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Catalog; -using eShopOnContainers.Core.Models.Marketing; -using eShopOnContainers.Core.ViewModels.Base; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text.RegularExpressions; -using eShopOnContainers.Core.Services.Settings; - -namespace eShopOnContainers.Core.Services.FixUri -{ - public class FixUriService : IFixUriService - { - private readonly ISettingsService _settingsService; - - private Regex IpRegex = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"); - - public FixUriService(ISettingsService settingsService) - { - _settingsService = settingsService; - } - - public void FixCatalogItemPictureUri(IEnumerable catalogItems) - { - if (catalogItems == null) - { - return; - } - - try - { - if (!ViewModelLocator.UseMockService - && _settingsService.IdentityEndpointBase != GlobalSetting.DefaultEndpoint) - { - foreach (var catalogItem in catalogItems) - { - MatchCollection serverResult = IpRegex.Matches(catalogItem.PictureUri); - MatchCollection localResult = IpRegex.Matches(_settingsService.IdentityEndpointBase); - - if (serverResult.Count != -1 && localResult.Count != -1) - { - var serviceIp = serverResult[0].Value; - var localIp = localResult[0].Value; - - catalogItem.PictureUri = catalogItem.PictureUri.Replace(serviceIp, localIp); - } - } - } - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message); - } - } - - public void FixBasketItemPictureUri(IEnumerable basketItems) - { - if (basketItems == null) - { - return; - } - - try - { - if (!ViewModelLocator.UseMockService - && _settingsService.IdentityEndpointBase != GlobalSetting.DefaultEndpoint) - { - foreach (var basketItem in basketItems) - { - MatchCollection serverResult = IpRegex.Matches(basketItem.PictureUrl); - MatchCollection localResult = IpRegex.Matches(_settingsService.IdentityEndpointBase); - - if (serverResult.Count != -1 && localResult.Count != -1) - { - var serviceIp = serverResult[0].Value; - var localIp = localResult[0].Value; - basketItem.PictureUrl = basketItem.PictureUrl.Replace(serviceIp, localIp); - } - } - } - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message); - } - } - - public void FixCampaignItemPictureUri(IEnumerable campaignItems) - { - if (campaignItems == null) - { - return; - } - - try - { - if (!ViewModelLocator.UseMockService - && _settingsService.IdentityEndpointBase != GlobalSetting.DefaultEndpoint) - { - foreach (var campaignItem in campaignItems) - { - MatchCollection serverResult = IpRegex.Matches(campaignItem.PictureUri); - MatchCollection localResult = IpRegex.Matches(_settingsService.IdentityEndpointBase); - - if (serverResult.Count != -1 && localResult.Count != -1) - { - var serviceIp = serverResult[0].Value; - var localIp = localResult[0].Value; - - campaignItem.PictureUri = campaignItem.PictureUri.Replace(serviceIp, localIp); - } - } - } - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message); - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/IFixUriService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/IFixUriService.cs deleted file mode 100644 index 901c7af866..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/FixUri/IFixUriService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Catalog; -using eShopOnContainers.Core.Models.Marketing; - -namespace eShopOnContainers.Core.Services.FixUri -{ - public interface IFixUriService - { - void FixCatalogItemPictureUri(IEnumerable catalogItems); - void FixBasketItemPictureUri(IEnumerable basketItems); - void FixCampaignItemPictureUri(IEnumerable campaignItems); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/AuthorizeRequest.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/AuthorizeRequest.cs deleted file mode 100644 index 23a4aabc3d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/AuthorizeRequest.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; - -namespace eShopOnContainers.Core.Services.Identity -{ - public class AuthorizeRequest - { - readonly Uri _authorizeEndpoint; - - public AuthorizeRequest(string authorizeEndpoint) - { - _authorizeEndpoint = new Uri(authorizeEndpoint); - } - - public string Create(IDictionary values) - { - var queryString = string.Join("&", values.Select(kvp => string.Format("{0}={1}", WebUtility.UrlEncode(kvp.Key), WebUtility.UrlEncode(kvp.Value))).ToArray()); - return string.Format("{0}?{1}", _authorizeEndpoint.AbsoluteUri, queryString); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IIdentityService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IIdentityService.cs deleted file mode 100644 index 81a2df0da0..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IIdentityService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using eShopOnContainers.Core.Models.Token; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Identity -{ - public interface IIdentityService - { - string CreateAuthorizationRequest(); - string CreateLogoutRequest(string token); - Task GetTokenAsync(string code); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IdentityService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IdentityService.cs deleted file mode 100644 index 0223b48c3c..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Identity/IdentityService.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Net; -using System.Text; -using System.Threading.Tasks; -using eShopOnContainers.Core.Services.RequestProvider; -using eShopOnContainers.Core.Models.Token; -using eShopOnContainers.Core.Helpers; -using IdentityModel; -using PCLCrypto; -using static PCLCrypto.WinRTCrypto; - -namespace eShopOnContainers.Core.Services.Identity -{ - public class IdentityService : IIdentityService - { - private readonly IRequestProvider _requestProvider; - private string _codeVerifier; - - public IdentityService(IRequestProvider requestProvider) - { - _requestProvider = requestProvider; - } - - public string CreateAuthorizationRequest() - { - // Create URI to authorization endpoint - var authorizeRequest = new AuthorizeRequest(GlobalSetting.Instance.AuthorizeEndpoint); - - // Dictionary with values for the authorize request - var dic = new Dictionary(); - dic.Add("client_id", GlobalSetting.Instance.ClientId); - dic.Add("client_secret", GlobalSetting.Instance.ClientSecret); - dic.Add("response_type", "code id_token"); - dic.Add("scope", "openid profile basket orders locations marketing offline_access"); - dic.Add("redirect_uri", GlobalSetting.Instance.Callback); - dic.Add("nonce", Guid.NewGuid().ToString("N")); - dic.Add("code_challenge", CreateCodeChallenge()); - dic.Add("code_challenge_method", "S256"); - - // Add CSRF token to protect against cross-site request forgery attacks. - var currentCSRFToken = Guid.NewGuid().ToString("N"); - dic.Add("state", currentCSRFToken); - - var authorizeUri = authorizeRequest.Create(dic); - return authorizeUri; - } - - public string CreateLogoutRequest(string token) - { - if (string.IsNullOrEmpty(token)) - { - return string.Empty; - } - - return string.Format("{0}?id_token_hint={1}&post_logout_redirect_uri={2}", - GlobalSetting.Instance.LogoutEndpoint, - token, - GlobalSetting.Instance.LogoutCallback); - } - - public async Task GetTokenAsync(string code) - { - string data = string.Format("grant_type=authorization_code&code={0}&redirect_uri={1}&code_verifier={2}", code, WebUtility.UrlEncode(GlobalSetting.Instance.Callback), _codeVerifier); - var token = await _requestProvider.PostAsync(GlobalSetting.Instance.TokenEndpoint, data, GlobalSetting.Instance.ClientId, GlobalSetting.Instance.ClientSecret); - return token; - } - - private string CreateCodeChallenge() - { - _codeVerifier = RandomNumberGenerator.CreateUniqueId(); - var sha256 = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithm.Sha256); - var challengeBuffer = sha256.HashData(CryptographicBuffer.CreateFromByteArray(Encoding.UTF8.GetBytes(_codeVerifier))); - byte[] challengeBytes; - CryptographicBuffer.CopyToByteArray(challengeBuffer, out challengeBytes); - return Base64Url.Encode(challengeBytes); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationService.cs deleted file mode 100644 index 31e9901221..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Location -{ - public interface ILocationService - { - Task UpdateUserLocation(eShopOnContainers.Core.Models.Location.Location newLocReq, string token); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationServiceImplementation.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationServiceImplementation.cs deleted file mode 100644 index 84abd98fc6..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/ILocationServiceImplementation.cs +++ /dev/null @@ -1,16 +0,0 @@ -using eShopOnContainers.Core.Models.Location; -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Location -{ - public interface ILocationServiceImplementation - { - double DesiredAccuracy { get; set; } - bool IsGeolocationAvailable { get; } - bool IsGeolocationEnabled { get; } - - Task GetPositionAsync(TimeSpan? timeout = null, CancellationToken? token = null); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/LocationService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/LocationService.cs deleted file mode 100644 index b930713680..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Location/LocationService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Threading.Tasks; -using eShopOnContainers.Core.Helpers; -using eShopOnContainers.Core.Services.RequestProvider; - -namespace eShopOnContainers.Core.Services.Location -{ - public class LocationService : ILocationService - { - private readonly IRequestProvider _requestProvider; - - private const string ApiUrlBase = "api/v1/l/locations"; - - public LocationService(IRequestProvider requestProvider) - { - _requestProvider = requestProvider; - } - - public async Task UpdateUserLocation(eShopOnContainers.Core.Models.Location.Location newLocReq, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayMarketingEndpoint, ApiUrlBase); - - await _requestProvider.PostAsync(uri, newLocReq, token); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs deleted file mode 100644 index fdc7c75fd2..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs +++ /dev/null @@ -1,51 +0,0 @@ -using eShopOnContainers.Core.Models.Marketing; -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Services.Marketing -{ - public class CampaignMockService : ICampaignService - { - private readonly ObservableCollection _mockCampaign = new ObservableCollection - { - new CampaignItem - { - Id = Common.Common.MockCampaignId01, - PictureUri = Device.RuntimePlatform != Device.UWP - ? "fake_campaign_01.png" - : "Assets/fake_campaign_01.png", - Name = ".NET Bot Black Hoodie 50% OFF", - Description = "Campaign Description 1", - From = DateTime.Now, - To = DateTime.Now.AddDays(7) - }, - - new CampaignItem - { - Id = Common.Common.MockCampaignId02, - PictureUri = Device.RuntimePlatform != Device.UWP - ? "fake_campaign_02.png" - : "Assets/fake_campaign_02.png", - Name = "Roslyn Red T-Shirt 3x2", - Description = "Campaign Description 2", - From = DateTime.Now.AddDays(-7), - To = DateTime.Now.AddDays(14) - } - }; - - public async Task> GetAllCampaignsAsync(string token) - { - await Task.Delay(10); - return _mockCampaign; - } - - public async Task GetCampaignByIdAsync(int campaignId, string token) - { - await Task.Delay(10); - return _mockCampaign.SingleOrDefault(c => c.Id == campaignId); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignService.cs deleted file mode 100644 index 7ff7ae50d9..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignService.cs +++ /dev/null @@ -1,47 +0,0 @@ -using eShopOnContainers.Core.Extensions; -using eShopOnContainers.Core.Helpers; -using eShopOnContainers.Core.Models.Marketing; -using eShopOnContainers.Core.Services.FixUri; -using eShopOnContainers.Core.Services.RequestProvider; -using System; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Marketing -{ - public class CampaignService : ICampaignService - { - private readonly IRequestProvider _requestProvider; - private readonly IFixUriService _fixUriService; - - private const string ApiUrlBase = "api/v1/m/campaigns"; - - public CampaignService(IRequestProvider requestProvider, IFixUriService fixUriService) - { - _requestProvider = requestProvider; - _fixUriService = fixUriService; - } - - public async Task> GetAllCampaignsAsync(string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayMarketingEndpoint, $"{ApiUrlBase}/user"); - - CampaignRoot campaign = await _requestProvider.GetAsync(uri, token); - - if (campaign?.Data != null) - { - _fixUriService.FixCampaignItemPictureUri(campaign?.Data); - return campaign?.Data.ToObservableCollection(); - } - - return new ObservableCollection(); - } - - public async Task GetCampaignByIdAsync(int campaignId, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayMarketingEndpoint, $"{ApiUrlBase}/{campaignId}"); - - return await _requestProvider.GetAsync(uri, token); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/ICampaignService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/ICampaignService.cs deleted file mode 100644 index ec1b821ef0..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/ICampaignService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using eShopOnContainers.Core.Models.Marketing; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Marketing -{ - public interface ICampaignService - { - Task> GetAllCampaignsAsync(string token); - Task GetCampaignByIdAsync(int id, string token); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/INavigationService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/INavigationService.cs deleted file mode 100644 index e048436799..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/INavigationService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using eShopOnContainers.Core.ViewModels.Base; -using System.Threading.Tasks; - -namespace eShopOnContainers.Services -{ - public interface INavigationService - { - ViewModelBase PreviousPageViewModel { get; } - - Task InitializeAsync(); - - Task NavigateToAsync() where TViewModel : ViewModelBase; - - Task NavigateToAsync(object parameter) where TViewModel : ViewModelBase; - - Task RemoveLastFromBackStackAsync(); - - Task RemoveBackStackAsync(); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs deleted file mode 100644 index 3481cccf5e..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Navigation/NavigationService.cs +++ /dev/null @@ -1,124 +0,0 @@ -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels; -using eShopOnContainers.Core.ViewModels.Base; -using eShopOnContainers.Core.Views; -using System; -using System.Globalization; -using System.Reflection; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Services -{ - public class NavigationService : INavigationService - { - private readonly ISettingsService _settingsService; - - public ViewModelBase PreviousPageViewModel - { - get - { - var mainPage = Application.Current.MainPage as CustomNavigationView; - var viewModel = mainPage.Navigation.NavigationStack[mainPage.Navigation.NavigationStack.Count - 2].BindingContext; - return viewModel as ViewModelBase; - } - } - - public NavigationService(ISettingsService settingsService) - { - _settingsService = settingsService; - } - - public Task InitializeAsync() - { - if (string.IsNullOrEmpty(_settingsService.AuthAccessToken)) - return NavigateToAsync(); - else - return NavigateToAsync(); - } - - public Task NavigateToAsync() where TViewModel : ViewModelBase - { - return InternalNavigateToAsync(typeof(TViewModel), null); - } - - public Task NavigateToAsync(object parameter) where TViewModel : ViewModelBase - { - return InternalNavigateToAsync(typeof(TViewModel), parameter); - } - - public Task RemoveLastFromBackStackAsync() - { - var mainPage = Application.Current.MainPage as CustomNavigationView; - - if (mainPage != null) - { - mainPage.Navigation.RemovePage( - mainPage.Navigation.NavigationStack[mainPage.Navigation.NavigationStack.Count - 2]); - } - - return Task.FromResult(true); - } - - public Task RemoveBackStackAsync() - { - var mainPage = Application.Current.MainPage as CustomNavigationView; - - if (mainPage != null) - { - for (int i = 0; i < mainPage.Navigation.NavigationStack.Count - 1; i++) - { - var page = mainPage.Navigation.NavigationStack[i]; - mainPage.Navigation.RemovePage(page); - } - } - - return Task.FromResult(true); - } - - private async Task InternalNavigateToAsync(Type viewModelType, object parameter) - { - Page page = CreatePage(viewModelType, parameter); - - if (page is LoginView) - { - Application.Current.MainPage = new CustomNavigationView(page); - } - else - { - var navigationPage = Application.Current.MainPage as CustomNavigationView; - if (navigationPage != null) - { - await navigationPage.PushAsync(page); - } - else - { - Application.Current.MainPage = new CustomNavigationView(page); - } - } - - await (page.BindingContext as ViewModelBase).InitializeAsync(parameter); - } - - private Type GetPageTypeForViewModel(Type viewModelType) - { - var viewName = viewModelType.FullName.Replace("Model", string.Empty); - var viewModelAssemblyName = viewModelType.GetTypeInfo().Assembly.FullName; - var viewAssemblyName = string.Format(CultureInfo.InvariantCulture, "{0}, {1}", viewName, viewModelAssemblyName); - var viewType = Type.GetType(viewAssemblyName); - return viewType; - } - - private Page CreatePage(Type viewModelType, object parameter) - { - Type pageType = GetPageTypeForViewModel(viewModelType); - if (pageType == null) - { - throw new Exception($"Cannot locate page type for {viewModelType}"); - } - - Page page = Activator.CreateInstance(pageType) as Page; - return page; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/IOpenUrlService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/IOpenUrlService.cs deleted file mode 100644 index 16de6df3c6..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/IOpenUrlService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace eShopOnContainers.Core.Services.OpenUrl -{ - public interface IOpenUrlService - { - void OpenUrl(string url); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/OpenUrlService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/OpenUrlService.cs deleted file mode 100644 index 0664bf4a45..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/OpenUrl/OpenUrlService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Services.OpenUrl -{ - public class OpenUrlService : IOpenUrlService - { - public void OpenUrl(string url) - { - Device.OpenUri(new Uri(url)); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/IOrderService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/IOrderService.cs deleted file mode 100644 index eb975180cb..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/IOrderService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Order -{ - public interface IOrderService - { - Task CreateOrderAsync(Models.Orders.Order newOrder, string token); - Task> GetOrdersAsync(string token); - Task GetOrderAsync(int orderId, string token); - Task CancelOrderAsync(int orderId, string token); - BasketCheckout MapOrderToBasket(Models.Orders.Order order); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs deleted file mode 100644 index 185989255a..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs +++ /dev/null @@ -1,120 +0,0 @@ -using eShopOnContainers.Core.Extensions; -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Orders; -using eShopOnContainers.Core.Models.User; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Services.Order -{ - public class OrderMockService : IOrderService - { - private static DateTime MockExpirationDate = DateTime.Now.AddYears(5); - - private static Address MockAdress = new Address - { - Id = Guid.NewGuid(), - City = "Seattle, WA", - Street = "120 E 87th Street", - CountryCode = "98122", - Country = "United States", - Latitude = 40.785091, - Longitude = -73.968285, - State = "Seattle", - StateCode = "WA", - ZipCode = "98101" - }; - - private static PaymentInfo MockPaymentInfo = new PaymentInfo - { - Id = Guid.NewGuid(), - CardHolderName = "American Express", - CardNumber = "378282246310005", - CardType = new CardType - { - Id = 3, - Name = "MasterCard" - }, - Expiration = MockExpirationDate.ToString(), - ExpirationMonth = MockExpirationDate.Month, - ExpirationYear = MockExpirationDate.Year, - SecurityNumber = "123" - }; - - private List MockOrders = new List() - { - new Models.Orders.Order { OrderNumber = 1, SequenceNumber = 123, OrderDate = DateTime.Now, OrderStatus = OrderStatus.Submitted, OrderItems = MockOrderItems, CardTypeId = MockPaymentInfo.CardType.Id, CardHolderName = MockPaymentInfo.CardHolderName, CardNumber = MockPaymentInfo.CardNumber, CardSecurityNumber = MockPaymentInfo.SecurityNumber, CardExpiration = new DateTime(MockPaymentInfo.ExpirationYear, MockPaymentInfo.ExpirationMonth, 1), ShippingCity = MockAdress.City, ShippingState = MockAdress.State, ShippingCountry = MockAdress.Country, ShippingStreet = MockAdress.Street, Total = 36.46M }, - new Models.Orders.Order { OrderNumber = 2, SequenceNumber = 132, OrderDate = DateTime.Now, OrderStatus = OrderStatus.Paid, OrderItems = MockOrderItems, CardTypeId = MockPaymentInfo.CardType.Id, CardHolderName = MockPaymentInfo.CardHolderName, CardNumber = MockPaymentInfo.CardNumber, CardSecurityNumber = MockPaymentInfo.SecurityNumber, CardExpiration = new DateTime(MockPaymentInfo.ExpirationYear, MockPaymentInfo.ExpirationMonth, 1), ShippingCity = MockAdress.City, ShippingState = MockAdress.State, ShippingCountry = MockAdress.Country, ShippingStreet = MockAdress.Street, Total = 36.46M }, - new Models.Orders.Order { OrderNumber = 3, SequenceNumber = 231, OrderDate = DateTime.Now, OrderStatus = OrderStatus.Cancelled, OrderItems = MockOrderItems, CardTypeId = MockPaymentInfo.CardType.Id, CardHolderName = MockPaymentInfo.CardHolderName, CardNumber = MockPaymentInfo.CardNumber, CardSecurityNumber = MockPaymentInfo.SecurityNumber, CardExpiration = new DateTime(MockPaymentInfo.ExpirationYear, MockPaymentInfo.ExpirationMonth, 1), ShippingCity = MockAdress.City, ShippingState = MockAdress.State, ShippingCountry = MockAdress.Country, ShippingStreet = MockAdress.Street, Total = 36.46M }, - new Models.Orders.Order { OrderNumber = 4, SequenceNumber = 131, OrderDate = DateTime.Now, OrderStatus = OrderStatus.Shipped, OrderItems = MockOrderItems, CardTypeId = MockPaymentInfo.CardType.Id, CardHolderName = MockPaymentInfo.CardHolderName, CardNumber = MockPaymentInfo.CardNumber, CardSecurityNumber = MockPaymentInfo.SecurityNumber, CardExpiration = new DateTime(MockPaymentInfo.ExpirationYear, MockPaymentInfo.ExpirationMonth, 1), ShippingCity = MockAdress.City, ShippingState = MockAdress.State, ShippingCountry = MockAdress.Country, ShippingStreet = MockAdress.Street, Total = 36.46M } - }; - - private static List MockOrderItems = new List() - { - new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId01, Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M, PictureUrl = Device.RuntimePlatform != Device.UWP ? "fake_product_01.png" : "Assets/fake_product_01.png" }, - new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId03, Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M, PictureUrl = Device.RuntimePlatform != Device.UWP ? "fake_product_03.png" : "Assets/fake_product_03.png" } - }; - - private static BasketCheckout MockBasketCheckout = new BasketCheckout() - { - CardExpiration = DateTime.UtcNow, - CardHolderName = "FakeCardHolderName", - CardNumber = "122333423224", - CardSecurityNumber = "1234", - CardTypeId = 1, - City = "FakeCity", - Country = "FakeCountry", - ZipCode = "FakeZipCode", - Street = "FakeStreet" - }; - - public async Task> GetOrdersAsync(string token) - { - await Task.Delay(10); - - if (!string.IsNullOrEmpty(token)) - { - return MockOrders - .OrderByDescending(o => o.OrderNumber) - .ToObservableCollection(); - } - else - return new ObservableCollection(); - } - - public async Task GetOrderAsync(int orderId, string token) - { - await Task.Delay(10); - - if (!string.IsNullOrEmpty(token)) - return MockOrders - .FirstOrDefault(o => o.OrderNumber.Equals(orderId)); - else - return new Models.Orders.Order(); - } - - public async Task CreateOrderAsync(Models.Orders.Order newOrder, string token) - { - await Task.Delay(10); - - if (!string.IsNullOrEmpty(token)) - { - MockOrders.Add(newOrder); - } - } - - public BasketCheckout MapOrderToBasket(Models.Orders.Order order) - { - return MockBasketCheckout; - } - - public Task CancelOrderAsync(int orderId, string token) - { - return Task.FromResult(true); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderService.cs deleted file mode 100644 index 3447a21d24..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderService.cs +++ /dev/null @@ -1,94 +0,0 @@ -using eShopOnContainers.Core.Helpers; -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Orders; -using eShopOnContainers.Core.Services.RequestProvider; -using System; -using System.Collections.ObjectModel; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Order -{ - public class OrderService : IOrderService - { - private readonly IRequestProvider _requestProvider; - - private const string ApiUrlBase = "api/v1/o/orders"; - - public OrderService(IRequestProvider requestProvider) - { - _requestProvider = requestProvider; - } - - public Task CreateOrderAsync(Models.Orders.Order newOrder, string token) - { - throw new Exception("Only available in Mock Services!"); - } - - public async Task> GetOrdersAsync(string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, ApiUrlBase); - - ObservableCollection orders = - await _requestProvider.GetAsync>(uri, token); - - return orders; - - } - - public async Task GetOrderAsync(int orderId, string token) - { - try - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/{orderId}"); - - Models.Orders.Order order = - await _requestProvider.GetAsync(uri, token); - - return order; - } - catch - { - return new Models.Orders.Order(); - } - } - - public BasketCheckout MapOrderToBasket(Models.Orders.Order order) - { - return new BasketCheckout() - { - CardExpiration = order.CardExpiration, - CardHolderName = order.CardHolderName, - CardNumber = order.CardNumber, - CardSecurityNumber = order.CardSecurityNumber, - CardTypeId = order.CardTypeId, - City = order.ShippingCity, - State = order.ShippingState, - Country = order.ShippingCountry, - ZipCode = order.ShippingZipCode, - Street = order.ShippingStreet - }; - } - - public async Task CancelOrderAsync(int orderId, string token) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.GatewayShoppingEndpoint, $"{ApiUrlBase}/cancel"); - - var cancelOrderCommand = new CancelOrderCommand(orderId); - - var header = "x-requestid"; - - try - { - await _requestProvider.PutAsync(uri, cancelOrderCommand, token, header); - } - //If the status of the order has changed before to click cancel button, we will get - //a BadRequest HttpStatus - catch (HttpRequestExceptionEx ex) when (ex.HttpCode == System.Net.HttpStatusCode.BadRequest) - { - return false; - } - - return true; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Permissions/IPermissionsService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Permissions/IPermissionsService.cs deleted file mode 100644 index b72061cc1c..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Permissions/IPermissionsService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using eShopOnContainers.Core.Models.Permissions; - -namespace eShopOnContainers.Core.Services.Permissions -{ - public interface IPermissionsService - { - Task CheckPermissionStatusAsync(Permission permission); - Task> RequestPermissionsAsync(params Permission[] permissions); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/HttpRequestExceptionEx.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/HttpRequestExceptionEx.cs deleted file mode 100644 index 4ab0d27e60..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/HttpRequestExceptionEx.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Net.Http; - -namespace eShopOnContainers.Core.Services.RequestProvider -{ - public class HttpRequestExceptionEx : HttpRequestException - { - public System.Net.HttpStatusCode HttpCode { get; } - public HttpRequestExceptionEx(System.Net.HttpStatusCode code) : this(code, null, null) - { - } - - public HttpRequestExceptionEx(System.Net.HttpStatusCode code, string message) : this (code, message, null) - { - } - - public HttpRequestExceptionEx(System.Net.HttpStatusCode code, string message, Exception inner) : base(message, - inner) - { - HttpCode = code; - } - - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/IRequestProvider.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/IRequestProvider.cs deleted file mode 100644 index 74856b1306..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/IRequestProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.RequestProvider -{ - public interface IRequestProvider - { - Task GetAsync(string uri, string token = ""); - - Task PostAsync(string uri, TResult data, string token = "", string header = ""); - - Task PostAsync(string uri, string data, string clientId, string clientSecret); - - Task PutAsync(string uri, TResult data, string token = "", string header = ""); - - Task DeleteAsync(string uri, string token = ""); - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/RequestProvider.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/RequestProvider.cs deleted file mode 100644 index f7d914bebc..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/RequestProvider/RequestProvider.cs +++ /dev/null @@ -1,164 +0,0 @@ -using eShopOnContainers.Core.Exceptions; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Serialization; -using System; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.RequestProvider -{ - public class RequestProvider : IRequestProvider - { - private readonly JsonSerializerSettings _serializerSettings; - - public RequestProvider() - { - _serializerSettings = new JsonSerializerSettings - { - ContractResolver = new CamelCasePropertyNamesContractResolver(), - DateTimeZoneHandling = DateTimeZoneHandling.Utc, - NullValueHandling = NullValueHandling.Ignore - }; - _serializerSettings.Converters.Add(new StringEnumConverter()); - } - - public async Task GetAsync(string uri, string token = "") - { - HttpClient httpClient = CreateHttpClient(token); - HttpResponseMessage response = await httpClient.GetAsync(uri); - - await HandleResponse(response); - string serialized = await response.Content.ReadAsStringAsync(); - - TResult result = await Task.Run(() => - JsonConvert.DeserializeObject(serialized, _serializerSettings)); - - return result; - } - - public async Task PostAsync(string uri, TResult data, string token = "", string header = "") - { - HttpClient httpClient = CreateHttpClient(token); - - if (!string.IsNullOrEmpty(header)) - { - AddHeaderParameter(httpClient, header); - } - - var content = new StringContent(JsonConvert.SerializeObject(data)); - content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - HttpResponseMessage response = await httpClient.PostAsync(uri, content); - - await HandleResponse(response); - string serialized = await response.Content.ReadAsStringAsync(); - - TResult result = await Task.Run(() => - JsonConvert.DeserializeObject(serialized, _serializerSettings)); - - return result; - } - - public async Task PostAsync(string uri, string data, string clientId, string clientSecret) - { - HttpClient httpClient = CreateHttpClient(string.Empty); - - if (!string.IsNullOrWhiteSpace(clientId) && !string.IsNullOrWhiteSpace(clientSecret)) - { - AddBasicAuthenticationHeader(httpClient, clientId, clientSecret); - } - - var content = new StringContent(data); - content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); - HttpResponseMessage response = await httpClient.PostAsync(uri, content); - - await HandleResponse(response); - string serialized = await response.Content.ReadAsStringAsync(); - - TResult result = await Task.Run(() => - JsonConvert.DeserializeObject(serialized, _serializerSettings)); - - return result; - } - - public async Task PutAsync(string uri, TResult data, string token = "", string header = "") - { - HttpClient httpClient = CreateHttpClient(token); - - if (!string.IsNullOrEmpty(header)) - { - AddHeaderParameter(httpClient, header); - } - - var content = new StringContent(JsonConvert.SerializeObject(data)); - content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - HttpResponseMessage response = await httpClient.PutAsync(uri, content); - - await HandleResponse(response); - string serialized = await response.Content.ReadAsStringAsync(); - - TResult result = await Task.Run(() => - JsonConvert.DeserializeObject(serialized, _serializerSettings)); - - return result; - } - - public async Task DeleteAsync(string uri, string token = "") - { - HttpClient httpClient = CreateHttpClient(token); - await httpClient.DeleteAsync(uri); - } - - private HttpClient CreateHttpClient(string token = "") - { - var httpClient = new HttpClient(); - httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - - if (!string.IsNullOrEmpty(token)) - { - httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); - } - return httpClient; - } - - private void AddHeaderParameter(HttpClient httpClient, string parameter) - { - if (httpClient == null) - return; - - if (string.IsNullOrEmpty(parameter)) - return; - - httpClient.DefaultRequestHeaders.Add(parameter, Guid.NewGuid().ToString()); - } - - private void AddBasicAuthenticationHeader(HttpClient httpClient, string clientId, string clientSecret) - { - if (httpClient == null) - return; - - if (string.IsNullOrWhiteSpace(clientId) || string.IsNullOrWhiteSpace(clientSecret)) - return; - - httpClient.DefaultRequestHeaders.Authorization = new BasicAuthenticationHeaderValue(clientId, clientSecret); - } - - private async Task HandleResponse(HttpResponseMessage response) - { - if (!response.IsSuccessStatusCode) - { - var content = await response.Content.ReadAsStringAsync(); - - if (response.StatusCode == HttpStatusCode.Forbidden || - response.StatusCode == HttpStatusCode.Unauthorized) - { - throw new ServiceAuthenticationException(content); - } - - throw new HttpRequestExceptionEx(response.StatusCode, content); - } - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/ISettingsService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/ISettingsService.cs deleted file mode 100644 index c110f98e30..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/ISettingsService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.Settings -{ - public interface ISettingsService - { - string AuthAccessToken { get; set; } - string AuthIdToken { get; set; } - bool UseMocks { get; set; } - string IdentityEndpointBase { get; set; } - string GatewayShoppingEndpointBase { get; set; } - string GatewayMarketingEndpointBase { get; set; } - bool UseFakeLocation { get; set; } - string Latitude { get; set; } - string Longitude { get; set; } - bool AllowGpsLocation { get; set; } - - bool GetValueOrDefault(string key, bool defaultValue); - string GetValueOrDefault(string key, string defaultValue); - Task AddOrUpdateValue(string key, bool value); - Task AddOrUpdateValue(string key, string value); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/SettingsService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/SettingsService.cs deleted file mode 100644 index 76dee8ddde..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Settings/SettingsService.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Threading.Tasks; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Services.Settings -{ - public class SettingsService : ISettingsService - { - #region Setting Constants - - private const string AccessToken = "access_token"; - private const string IdToken = "id_token"; - private const string IdUseMocks = "use_mocks"; - private const string IdIdentityBase = "url_base"; - private const string IdGatewayMarketingBase = "url_marketing"; - private const string IdGatewayShoppingBase = "url_shopping"; - private const string IdUseFakeLocation = "use_fake_location"; - private const string IdLatitude = "latitude"; - private const string IdLongitude = "longitude"; - private const string IdAllowGpsLocation = "allow_gps_location"; - private readonly string AccessTokenDefault = string.Empty; - private readonly string IdTokenDefault = string.Empty; - private readonly bool UseMocksDefault = true; - private readonly bool UseFakeLocationDefault = false; - private readonly bool AllowGpsLocationDefault = false; - private readonly double FakeLatitudeDefault = 47.604610d; - private readonly double FakeLongitudeDefault = -122.315752d; - private readonly string UrlIdentityDefault = GlobalSetting.Instance.BaseIdentityEndpoint; - private readonly string UrlGatewayMarketingDefault = GlobalSetting.Instance.BaseGatewayMarketingEndpoint; - private readonly string UrlGatewayShoppingDefault = GlobalSetting.Instance.BaseGatewayShoppingEndpoint; - #endregion - - #region Settings Properties - - public string AuthAccessToken - { - get => GetValueOrDefault(AccessToken, AccessTokenDefault); - set => AddOrUpdateValue(AccessToken, value); - } - - public string AuthIdToken - { - get => GetValueOrDefault(IdToken, IdTokenDefault); - set => AddOrUpdateValue(IdToken, value); - } - - public bool UseMocks - { - get => GetValueOrDefault(IdUseMocks, UseMocksDefault); - set => AddOrUpdateValue(IdUseMocks, value); - } - - public string IdentityEndpointBase - { - get => GetValueOrDefault(IdIdentityBase, UrlIdentityDefault); - set => AddOrUpdateValue(IdIdentityBase, value); - } - - public string GatewayShoppingEndpointBase - { - get => GetValueOrDefault(IdGatewayShoppingBase, UrlGatewayShoppingDefault); - set => AddOrUpdateValue(IdGatewayShoppingBase, value); - } - - public string GatewayMarketingEndpointBase - { - get => GetValueOrDefault(IdGatewayMarketingBase, UrlGatewayMarketingDefault); - set => AddOrUpdateValue(IdGatewayMarketingBase, value); - } - - public bool UseFakeLocation - { - get => GetValueOrDefault(IdUseFakeLocation, UseFakeLocationDefault); - set => AddOrUpdateValue(IdUseFakeLocation, value); - } - - public string Latitude - { - get => GetValueOrDefault(IdLatitude, FakeLatitudeDefault.ToString()); - set => AddOrUpdateValue(IdLatitude, value); - } - - public string Longitude - { - get => GetValueOrDefault(IdLongitude, FakeLongitudeDefault.ToString()); - set => AddOrUpdateValue(IdLongitude, value); - } - - public bool AllowGpsLocation - { - get => GetValueOrDefault(IdAllowGpsLocation, AllowGpsLocationDefault); - set => AddOrUpdateValue(IdAllowGpsLocation, value); - } - - #endregion - - #region Public Methods - - public Task AddOrUpdateValue(string key, bool value) => AddOrUpdateValueInternal(key, value); - public Task AddOrUpdateValue(string key, string value) => AddOrUpdateValueInternal(key, value); - public bool GetValueOrDefault(string key, bool defaultValue) => GetValueOrDefaultInternal(key, defaultValue); - public string GetValueOrDefault(string key, string defaultValue) => GetValueOrDefaultInternal(key, defaultValue); - - #endregion - - #region Internal Implementation - - async Task AddOrUpdateValueInternal(string key, T value) - { - if (value == null) - { - await Remove(key); - } - - Application.Current.Properties[key] = value; - try - { - await Application.Current.SavePropertiesAsync(); - } - catch (Exception ex) - { - Console.WriteLine("Unable to save: " + key, " Message: " + ex.Message); - } - } - - T GetValueOrDefaultInternal(string key, T defaultValue = default(T)) - { - object value = null; - if (Application.Current.Properties.ContainsKey(key)) - { - value = Application.Current.Properties[key]; - } - return null != value ? (T)value : defaultValue; - } - - async Task Remove(string key) - { - try - { - if (Application.Current.Properties[key] != null) - { - Application.Current.Properties.Remove(key); - await Application.Current.SavePropertiesAsync(); - } - } - catch (Exception ex) - { - Console.WriteLine("Unable to remove: " + key, " Message: " + ex.Message); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs deleted file mode 100644 index 5fac815016..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/IUserService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using eShopOnContainers.Core.Models.User; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.User -{ - public interface IUserService - { - Task GetUserInfoAsync(string authToken); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs deleted file mode 100644 index fb75ec03e4..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserMockService.cs +++ /dev/null @@ -1,35 +0,0 @@ -using eShopOnContainers.Core.Models.User; -using System; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.User -{ - public class UserMockService : IUserService - { - private UserInfo MockUserInfo = new UserInfo - { - UserId = Guid.NewGuid().ToString(), - Name = "Jhon", - LastName = "Doe", - PreferredUsername = "Jdoe", - Email = "jdoe@eshop.com", - EmailVerified = true, - PhoneNumber = "202-555-0165", - PhoneNumberVerified = true, - Address = "Seattle, WA", - Street = "120 E 87th Street", - ZipCode = "98101", - Country = "United States", - State = "Seattle", - CardNumber = "378282246310005", - CardHolder = "American Express", - CardSecurityNumber = "1234" - }; - - public async Task GetUserInfoAsync(string authToken) - { - await Task.Delay(10); - return MockUserInfo; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserService.cs deleted file mode 100644 index 6056fcf7f8..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/User/UserService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using eShopOnContainers.Core.Helpers; -using eShopOnContainers.Core.Models.User; -using eShopOnContainers.Core.Services.RequestProvider; -using System; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.Services.User -{ - public class UserService : IUserService - { - private readonly IRequestProvider _requestProvider; - - public UserService(IRequestProvider requestProvider) - { - _requestProvider = requestProvider; - } - - public async Task GetUserInfoAsync(string authToken) - { - var uri = UriHelper.CombineUri(GlobalSetting.Instance.UserInfoEndpoint); - - var userInfo = await _requestProvider.GetAsync(uri, authToken); - return userInfo; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/TinyIoC/TinyIoC.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/TinyIoC/TinyIoC.cs deleted file mode 100755 index b161e42eb8..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/TinyIoC/TinyIoC.cs +++ /dev/null @@ -1,4303 +0,0 @@ -//=============================================================================== -// TinyIoC -// -// An easy to use, hassle free, Inversion of Control Container for small projects -// and beginners alike. -// -// https://github.com/grumpydev/TinyIoC -//=============================================================================== -// Copyright © Steven Robbins. All rights reserved. -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY -// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT -// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE. -//=============================================================================== - -#region Preprocessor Directives -// Uncomment this line if you want the container to automatically -// register the TinyMessenger messenger/event aggregator -//#define TINYMESSENGER - -// Uncomment this line if you want to internalize this library -//#define TINYIOC_INTERNAL - -// Uncomment this line if you want to target PCL. -//#define PORTABLE - -// Preprocessor directives for enabling/disabling functionality -// depending on platform features. If the platform has an appropriate -// #DEFINE then these should be set automatically below. -#define EXPRESSIONS - -// Platform supports System.Linq.Expressions -#define COMPILED_EXPRESSIONS // Platform supports compiling expressions -#define APPDOMAIN_GETASSEMBLIES // Platform supports getting all assemblies from the AppDomain object -#define UNBOUND_GENERICS_GETCONSTRUCTORS // Platform supports GetConstructors on unbound generic types -#define GETPARAMETERS_OPEN_GENERICS // Platform supports GetParameters on open generics -#define RESOLVE_OPEN_GENERICS // Platform supports resolving open generics -#define READER_WRITER_LOCK_SLIM // Platform supports ReaderWriterLockSlim -#define SERIALIZABLE // Platform supports SerializableAttribute/SerializationInfo/StreamingContext - -#if PORTABLE -#undef APPDOMAIN_GETASSEMBLIES -#undef COMPILED_EXPRESSIONS -#undef READER_WRITER_LOCK_SLIM -#undef SERIALIZABLE -#endif - -#if NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 -#undef COMPILED_EXPRESSIONS -#undef READER_WRITER_LOCK_SLIM -#endif - -#if NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 -#undef APPDOMAIN_GETASSEMBLIES -#endif - -#if NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 -#undef SERIALIZABLE -#endif - -// CompactFramework / Windows Phone 7 -// By default does not support System.Linq.Expressions. -// AppDomain object does not support enumerating all assemblies in the app domain. -#if PocketPC || WINDOWS_PHONE -#undef EXPRESSIONS -#undef COMPILED_EXPRESSIONS -#undef APPDOMAIN_GETASSEMBLIES -#undef UNBOUND_GENERICS_GETCONSTRUCTORS -#endif - -// PocketPC has a bizarre limitation on enumerating parameters on unbound generic methods. -// We need to use a slower workaround in that case. -#if PocketPC -#undef GETPARAMETERS_OPEN_GENERICS -#undef RESOLVE_OPEN_GENERICS -#undef READER_WRITER_LOCK_SLIM -#endif - -#if SILVERLIGHT -#undef APPDOMAIN_GETASSEMBLIES -#endif - -#if NETFX_CORE -#undef APPDOMAIN_GETASSEMBLIES -#undef RESOLVE_OPEN_GENERICS -#endif - -#if COMPILED_EXPRESSIONS -#define USE_OBJECT_CONSTRUCTOR -#endif - -#endregion -#if SERIALIZABLE -using System.Runtime.Serialization; -#endif - -namespace TinyIoC -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Linq; - using System.Reflection; - -#if EXPRESSIONS - using System.Linq.Expressions; - using System.Threading; - -#endif - -#if NETFX_CORE - using System.Threading.Tasks; - using Windows.Storage.Search; - using Windows.Storage; - using Windows.UI.Xaml.Shapes; -#endif - - #region SafeDictionary -#if READER_WRITER_LOCK_SLIM -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class SafeDictionary : IDisposable - { - private readonly ReaderWriterLockSlim _padlock = new ReaderWriterLockSlim(); - private readonly Dictionary _Dictionary = new Dictionary(); - - public TValue this[TKey key] - { - set - { - _padlock.EnterWriteLock(); - - try - { - TValue current; - if (_Dictionary.TryGetValue(key, out current)) - { - var disposable = current as IDisposable; - - if (disposable != null) - disposable.Dispose(); - } - - _Dictionary[key] = value; - } - finally - { - _padlock.ExitWriteLock(); - } - } - } - - public bool TryGetValue(TKey key, out TValue value) - { - _padlock.EnterReadLock(); - try - { - return _Dictionary.TryGetValue(key, out value); - } - finally - { - _padlock.ExitReadLock(); - } - } - - public bool Remove(TKey key) - { - _padlock.EnterWriteLock(); - try - { - return _Dictionary.Remove(key); - } - finally - { - _padlock.ExitWriteLock(); - } - } - - public void Clear() - { - _padlock.EnterWriteLock(); - try - { - _Dictionary.Clear(); - } - finally - { - _padlock.ExitWriteLock(); - } - } - - public IEnumerable Keys - { - get - { - _padlock.EnterReadLock(); - try - { - return new List(_Dictionary.Keys); - } - finally - { - _padlock.ExitReadLock(); - } - } - } - - #region IDisposable Members - - public void Dispose() - { - _padlock.EnterWriteLock(); - - try - { - var disposableItems = from item in _Dictionary.Values - where item is IDisposable - select item as IDisposable; - - foreach (var item in disposableItems) - { - item.Dispose(); - } - } - finally - { - _padlock.ExitWriteLock(); - } - - GC.SuppressFinalize(this); - } - - #endregion - } -#else -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class SafeDictionary : IDisposable - { - private readonly object _Padlock = new object(); - private readonly Dictionary _Dictionary = new Dictionary(); - - public TValue this[TKey key] - { - set - { - lock (_Padlock) - { - TValue current; - if (_Dictionary.TryGetValue(key, out current)) - { - var disposable = current as IDisposable; - - if (disposable != null) - disposable.Dispose(); - } - - _Dictionary[key] = value; - } - } - } - - public bool TryGetValue(TKey key, out TValue value) - { - lock (_Padlock) - { - return _Dictionary.TryGetValue(key, out value); - } - } - - public bool Remove(TKey key) - { - lock (_Padlock) - { - return _Dictionary.Remove(key); - } - } - - public void Clear() - { - lock (_Padlock) - { - _Dictionary.Clear(); - } - } - - public IEnumerable Keys - { - get - { - return _Dictionary.Keys; - } - } - #region IDisposable Members - - public void Dispose() - { - lock (_Padlock) - { - var disposableItems = from item in _Dictionary.Values - where item is IDisposable - select item as IDisposable; - - foreach (var item in disposableItems) - { - item.Dispose(); - } - } - - GC.SuppressFinalize(this); - } - - #endregion - } -#endif - #endregion - - #region Extensions -#if TINYIOC_INTERNAL - internal -#else - public -#endif - static class AssemblyExtensions - { - public static Type[] SafeGetTypes(this Assembly assembly) - { - Type[] assemblies; - - try - { -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 - assemblies = assembly.ExportedTypes.ToArray(); -#else - assemblies = assembly.GetTypes(); -#endif - } - catch (System.IO.FileNotFoundException) - { - assemblies = new Type[] { }; - } - catch (NotSupportedException) - { - assemblies = new Type[] { }; - } -#if !NETFX_CORE - catch (ReflectionTypeLoadException e) - { - assemblies = e.Types.Where(t => t != null).ToArray(); - } -#endif - return assemblies; - } - } - -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 - [Flags] - internal enum BindingFlags { - Default = 0, - IgnoreCase = 1, - DeclaredOnly = 2, - Instance = 4, - Static = 8, - Public = 16, - NonPublic = 32, - FlattenHierarchy = 64, - InvokeMethod = 256, - CreateInstance = 512, - GetField = 1024, - SetField = 2048, - GetProperty = 4096, - SetProperty = 8192, - PutDispProperty = 16384, - ExactBinding = 65536, - PutRefDispProperty = 32768, - SuppressChangeType = 131072, - OptionalParamBinding = 262144, - IgnoreReturn = 16777216 - } -#endif - -#if TINYIOC_INTERNAL - internal -#else - public -#endif - static class TypeExtensions - { - private static SafeDictionary _genericMethodCache; - - static TypeExtensions() - { - _genericMethodCache = new SafeDictionary(); - } - -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 - private static BindingFlags DefaultFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance; - - public static ConstructorInfo[] GetConstructors(this Type type) - { - return type.GetConstructors(DefaultFlags); - } - - public static ConstructorInfo[] GetConstructors(this Type type, BindingFlags bindingFlags) - { - return type.GetConstructors(bindingFlags, null); - } - - private static ConstructorInfo[] GetConstructors(this Type type, BindingFlags bindingFlags, IList parameterTypes) - { - return type.GetTypeInfo().DeclaredConstructors.Where( - c => - { - if (!TestAccessibility(c, bindingFlags)) - { - return false; - } - - if (parameterTypes != null && !c.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes)) - { - return false; - } - - return true; - }).ToArray(); - } - - public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo) { - return propertyInfo.GetGetMethod(false); - } - - public static MethodInfo GetGetMethod(this PropertyInfo propertyInfo, bool nonPublic) { - MethodInfo getMethod = propertyInfo.GetMethod; - if (getMethod != null && (getMethod.IsPublic || nonPublic)) { - return getMethod; - } - - return null; - } - - public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo) { - return propertyInfo.GetSetMethod(false); - } - - public static MethodInfo GetSetMethod(this PropertyInfo propertyInfo, bool nonPublic) { - MethodInfo setMethod = propertyInfo.SetMethod; - if (setMethod != null && (setMethod.IsPublic || nonPublic)) { - return setMethod; - } - - return null; - } - - public static Type[] GetGenericArguments(this Type type) - { - return type.GetTypeInfo().GenericTypeArguments; - } - - public static IEnumerable GetProperties(this Type type) - { - TypeInfo t = type.GetTypeInfo(); - IList properties = new List(); - while (t != null) - { - foreach (PropertyInfo member in t.DeclaredProperties) - { - if (!properties.Any(p => p.Name == member.Name)) - { - properties.Add(member); - } - } - t = (t.BaseType != null) ? t.BaseType.GetTypeInfo() : null; - } - - return properties; - } - - public static IEnumerable GetInterfaces(this Type type) - { - return type.GetTypeInfo().ImplementedInterfaces; - } - - public static MethodInfo GetMethod(this Type type, string name, IList parameterTypes) - { - return type.GetMethod(name, DefaultFlags, null, parameterTypes, null); - } - - public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags, object placeHolder1, IList parameterTypes, object placeHolder2) - { - return type.GetTypeInfo().DeclaredMethods.Where( - m => - { - if (name != null && m.Name != name) - { - return false; - } - - if (!TestAccessibility(m, bindingFlags)) - { - return false; - } - - return m.GetParameters().Select(p => p.ParameterType).SequenceEqual(parameterTypes); - }).SingleOrDefault(); - } - - public static IEnumerable GetMethods(this Type type, BindingFlags bindingFlags) - { - return type.GetTypeInfo().DeclaredMethods; - } - - public static bool IsAssignableFrom(this Type type, Type c) - { - return type.GetTypeInfo().IsAssignableFrom(c.GetTypeInfo()); - } - - private static bool TestAccessibility(MethodBase member, BindingFlags bindingFlags) - { - bool visibility = (member.IsPublic && bindingFlags.HasFlag(BindingFlags.Public)) || - (!member.IsPublic && bindingFlags.HasFlag(BindingFlags.NonPublic)); - - bool instance = (member.IsStatic && bindingFlags.HasFlag(BindingFlags.Static)) || - (!member.IsStatic && bindingFlags.HasFlag(BindingFlags.Instance)); - - return visibility && instance; - } -#endif - - /// - /// Gets a generic method from a type given the method name, binding flags, generic types and parameter types - /// - /// Source type - /// Binding flags - /// Name of the method - /// Generic types to use to make the method generic - /// Method parameters - /// MethodInfo or null if no matches found - /// - /// - public static MethodInfo GetGenericMethod(this Type sourceType, BindingFlags bindingFlags, string methodName, Type[] genericTypes, Type[] parameterTypes) - { - MethodInfo method; - var cacheKey = new GenericMethodCacheKey(sourceType, methodName, genericTypes, parameterTypes); - - // Shouldn't need any additional locking - // we don't care if we do the method info generation - // more than once before it gets cached. - if (!_genericMethodCache.TryGetValue(cacheKey, out method)) - { - method = GetMethod(sourceType, bindingFlags, methodName, genericTypes, parameterTypes); - _genericMethodCache[cacheKey] = method; - } - - return method; - } - //#endif - -#if NETFX_CORE - private static MethodInfo GetMethod(Type sourceType, BindingFlags flags, string methodName, Type[] genericTypes, Type[] parameterTypes) - { - var methods = - sourceType.GetMethods(flags).Where( - mi => string.Equals(methodName, mi.Name, StringComparison.Ordinal)).Where( - mi => mi.ContainsGenericParameters).Where(mi => mi.GetGenericArguments().Length == genericTypes.Length). - Where(mi => mi.GetParameters().Length == parameterTypes.Length).Select( - mi => mi.MakeGenericMethod(genericTypes)).Where( - mi => mi.GetParameters().Select(pi => pi.ParameterType).SequenceEqual(parameterTypes)).ToList(); - - if (methods.Count > 1) - { - throw new AmbiguousMatchException(); - } - - return methods.FirstOrDefault(); - } -#else - private static MethodInfo GetMethod(Type sourceType, BindingFlags bindingFlags, string methodName, Type[] genericTypes, Type[] parameterTypes) - { -#if GETPARAMETERS_OPEN_GENERICS - var methods = - sourceType.GetMethods(bindingFlags).Where( - mi => string.Equals(methodName, mi.Name, StringComparison.Ordinal)).Where( - mi => mi.ContainsGenericParameters).Where(mi => mi.GetGenericArguments().Length == genericTypes.Length). - Where(mi => mi.GetParameters().Length == parameterTypes.Length).Select( - mi => mi.MakeGenericMethod(genericTypes)).Where( - mi => mi.GetParameters().Select(pi => pi.ParameterType).SequenceEqual(parameterTypes)).ToList(); -#else - var validMethods = from method in sourceType.GetMethods(bindingFlags) - where method.Name == methodName - where method.IsGenericMethod - where method.GetGenericArguments().Length == genericTypes.Length - let genericMethod = method.MakeGenericMethod(genericTypes) - where genericMethod.GetParameters().Count() == parameterTypes.Length - where genericMethod.GetParameters().Select(pi => pi.ParameterType).SequenceEqual(parameterTypes) - select genericMethod; - - var methods = validMethods.ToList(); -#endif - if (methods.Count > 1) - { - throw new AmbiguousMatchException(); - } - - return methods.FirstOrDefault(); - } -#endif - - private sealed class GenericMethodCacheKey - { - private readonly Type _sourceType; - - private readonly string _methodName; - - private readonly Type[] _genericTypes; - - private readonly Type[] _parameterTypes; - - private readonly int _hashCode; - - public GenericMethodCacheKey(Type sourceType, string methodName, Type[] genericTypes, Type[] parameterTypes) - { - _sourceType = sourceType; - _methodName = methodName; - _genericTypes = genericTypes; - _parameterTypes = parameterTypes; - _hashCode = GenerateHashCode(); - } - - public override bool Equals(object obj) - { - var cacheKey = obj as GenericMethodCacheKey; - if (cacheKey == null) - return false; - - if (_sourceType != cacheKey._sourceType) - return false; - - if (!String.Equals(_methodName, cacheKey._methodName, StringComparison.Ordinal)) - return false; - - if (_genericTypes.Length != cacheKey._genericTypes.Length) - return false; - - if (_parameterTypes.Length != cacheKey._parameterTypes.Length) - return false; - - for (int i = 0; i < _genericTypes.Length; ++i) - { - if (_genericTypes[i] != cacheKey._genericTypes[i]) - return false; - } - - for (int i = 0; i < _parameterTypes.Length; ++i) - { - if (_parameterTypes[i] != cacheKey._parameterTypes[i]) - return false; - } - - return true; - } - - public override int GetHashCode() - { - return _hashCode; - } - - private int GenerateHashCode() - { - unchecked - { - var result = _sourceType.GetHashCode(); - - result = (result * 397) ^ _methodName.GetHashCode(); - - for (int i = 0; i < _genericTypes.Length; ++i) - { - result = (result * 397) ^ _genericTypes[i].GetHashCode(); - } - - for (int i = 0; i < _parameterTypes.Length; ++i) - { - result = (result * 397) ^ _parameterTypes[i].GetHashCode(); - } - - return result; - } - } - } - - } - - // @mbrit - 2012-05-22 - shim for ForEach call on List... -#if NETFX_CORE - internal static class ListExtender - { - internal static void ForEach(this List list, Action callback) - { - foreach (T obj in list) - callback(obj); - } - } -#endif - -#endregion - -#region TinyIoC Exception Types -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCResolutionException : Exception - { - private const string ERROR_TEXT = "Unable to resolve type: {0}"; - - public TinyIoCResolutionException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) - { - } - - public TinyIoCResolutionException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) - { - } -#if SERIALIZABLE - protected TinyIoCResolutionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCRegistrationTypeException : Exception - { - private const string REGISTER_ERROR_TEXT = "Cannot register type {0} - abstract classes or interfaces are not valid implementation types for {1}."; - - public TinyIoCRegistrationTypeException(Type type, string factory) - : base(String.Format(REGISTER_ERROR_TEXT, type.FullName, factory)) - { - } - - public TinyIoCRegistrationTypeException(Type type, string factory, Exception innerException) - : base(String.Format(REGISTER_ERROR_TEXT, type.FullName, factory), innerException) - { - } -#if SERIALIZABLE - protected TinyIoCRegistrationTypeException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCRegistrationException : Exception - { - private const string CONVERT_ERROR_TEXT = "Cannot convert current registration of {0} to {1}"; - private const string GENERIC_CONSTRAINT_ERROR_TEXT = "Type {1} is not valid for a registration of type {0}"; - - public TinyIoCRegistrationException(Type type, string method) - : base(String.Format(CONVERT_ERROR_TEXT, type.FullName, method)) - { - } - - public TinyIoCRegistrationException(Type type, string method, Exception innerException) - : base(String.Format(CONVERT_ERROR_TEXT, type.FullName, method), innerException) - { - } - - public TinyIoCRegistrationException(Type registerType, Type implementationType) - : base(String.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName)) - { - } - - public TinyIoCRegistrationException(Type registerType, Type implementationType, Exception innerException) - : base(String.Format(GENERIC_CONSTRAINT_ERROR_TEXT, registerType.FullName, implementationType.FullName), innerException) - { - } -#if SERIALIZABLE - protected TinyIoCRegistrationException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCWeakReferenceException : Exception - { - private const string ERROR_TEXT = "Unable to instantiate {0} - referenced object has been reclaimed"; - - public TinyIoCWeakReferenceException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) - { - } - - public TinyIoCWeakReferenceException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) - { - } -#if SERIALIZABLE - protected TinyIoCWeakReferenceException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCConstructorResolutionException : Exception - { - private const string ERROR_TEXT = "Unable to resolve constructor for {0} using provided Expression."; - - public TinyIoCConstructorResolutionException(Type type) - : base(String.Format(ERROR_TEXT, type.FullName)) - { - } - - public TinyIoCConstructorResolutionException(Type type, Exception innerException) - : base(String.Format(ERROR_TEXT, type.FullName), innerException) - { - } - - public TinyIoCConstructorResolutionException(string message, Exception innerException) - : base(message, innerException) - { - } - - public TinyIoCConstructorResolutionException(string message) - : base(message) - { - } -#if SERIALIZABLE - protected TinyIoCConstructorResolutionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - } -#if SERIALIZABLE - [Serializable] -#endif -#if TINYIOC_INTERNAL - internal -#else - public -#endif - class TinyIoCAutoRegistrationException : Exception - { - private const string ERROR_TEXT = "Duplicate implementation of type {0} found ({1})."; - - public TinyIoCAutoRegistrationException(Type registerType, IEnumerable types) - : base(String.Format(ERROR_TEXT, registerType, GetTypesString(types))) - { - } - - public TinyIoCAutoRegistrationException(Type registerType, IEnumerable types, Exception innerException) - : base(String.Format(ERROR_TEXT, registerType, GetTypesString(types)), innerException) - { - } -#if SERIALIZABLE - protected TinyIoCAutoRegistrationException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } -#endif - - private static string GetTypesString(IEnumerable types) - { - var typeNames = from type in types - select type.FullName; - - return string.Join(",", typeNames.ToArray()); - } - } -#endregion - -#region Public Setup / Settings Classes - /// - /// Name/Value pairs for specifying "user" parameters when resolving - /// -#if TINYIOC_INTERNAL - internal -#else - public -#endif - sealed class NamedParameterOverloads : Dictionary - { - public static NamedParameterOverloads FromIDictionary(IDictionary data) - { - return data as NamedParameterOverloads ?? new NamedParameterOverloads(data); - } - - public NamedParameterOverloads() - { - } - - public NamedParameterOverloads(IDictionary data) - : base(data) - { - } - - private static readonly NamedParameterOverloads _Default = new NamedParameterOverloads(); - - public static NamedParameterOverloads Default - { - get - { - return _Default; - } - } - } - -#if TINYIOC_INTERNAL - internal -#else - public -#endif - enum UnregisteredResolutionActions - { - /// - /// Attempt to resolve type, even if the type isn't registered. - /// - /// Registered types/options will always take precedence. - /// - AttemptResolve, - - /// - /// Fail resolution if type not explicitly registered - /// - Fail, - - /// - /// Attempt to resolve unregistered type if requested type is generic - /// and no registration exists for the specific generic parameters used. - /// - /// Registered types/options will always take precedence. - /// - GenericsOnly - } - -#if TINYIOC_INTERNAL - internal -#else - public -#endif - enum NamedResolutionFailureActions - { - AttemptUnnamedResolution, - Fail - } - -#if TINYIOC_INTERNAL - internal -#else - public -#endif - enum DuplicateImplementationActions - { - RegisterSingle, - RegisterMultiple, - Fail - } - - /// - /// Resolution settings - /// -#if TINYIOC_INTERNAL - internal -#else - public -#endif - sealed class ResolveOptions - { - private static readonly ResolveOptions _Default = new ResolveOptions(); - private static readonly ResolveOptions _FailUnregisteredAndNameNotFound = new ResolveOptions() { NamedResolutionFailureAction = NamedResolutionFailureActions.Fail, UnregisteredResolutionAction = UnregisteredResolutionActions.Fail }; - private static readonly ResolveOptions _FailUnregisteredOnly = new ResolveOptions() { NamedResolutionFailureAction = NamedResolutionFailureActions.AttemptUnnamedResolution, UnregisteredResolutionAction = UnregisteredResolutionActions.Fail }; - private static readonly ResolveOptions _FailNameNotFoundOnly = new ResolveOptions() { NamedResolutionFailureAction = NamedResolutionFailureActions.Fail, UnregisteredResolutionAction = UnregisteredResolutionActions.AttemptResolve }; - - private UnregisteredResolutionActions _UnregisteredResolutionAction = UnregisteredResolutionActions.AttemptResolve; - public UnregisteredResolutionActions UnregisteredResolutionAction - { - get { return _UnregisteredResolutionAction; } - set { _UnregisteredResolutionAction = value; } - } - - private NamedResolutionFailureActions _NamedResolutionFailureAction = NamedResolutionFailureActions.Fail; - public NamedResolutionFailureActions NamedResolutionFailureAction - { - get { return _NamedResolutionFailureAction; } - set { _NamedResolutionFailureAction = value; } - } - - /// - /// Gets the default options (attempt resolution of unregistered types, fail on named resolution if name not found) - /// - public static ResolveOptions Default - { - get - { - return _Default; - } - } - - /// - /// Preconfigured option for attempting resolution of unregistered types and failing on named resolution if name not found - /// - public static ResolveOptions FailNameNotFoundOnly - { - get - { - return _FailNameNotFoundOnly; - } - } - - /// - /// Preconfigured option for failing on resolving unregistered types and on named resolution if name not found - /// - public static ResolveOptions FailUnregisteredAndNameNotFound - { - get - { - return _FailUnregisteredAndNameNotFound; - } - } - - /// - /// Preconfigured option for failing on resolving unregistered types, but attempting unnamed resolution if name not found - /// - public static ResolveOptions FailUnregisteredOnly - { - get - { - return _FailUnregisteredOnly; - } - } - } -#endregion - -#if TINYIOC_INTERNAL - internal -#else - public -#endif - sealed partial class TinyIoCContainer : IDisposable - { -#region Fake NETFX_CORE Classes -#if NETFX_CORE - private sealed class MethodAccessException : Exception - { - } - - private sealed class AppDomain - { - public static AppDomain CurrentDomain { get; private set; } - - static AppDomain() - { - CurrentDomain = new AppDomain(); - } - - // @mbrit - 2012-05-30 - in WinRT, this should be done async... - public async Task> GetAssembliesAsync() - { - var folder = Windows.ApplicationModel.Package.Current.InstalledLocation; - - List assemblies = new List(); - - var files = await folder.GetFilesAsync(); - - foreach (StorageFile file in files) - { - if (file.FileType == ".dll" || file.FileType == ".exe") - { - AssemblyName name = new AssemblyName() { Name = System.IO.Path.GetFileNameWithoutExtension(file.Name) }; - try - { - var asm = Assembly.Load(name); - assemblies.Add(asm); - } - catch - { - // ignore exceptions here... - } - } - } - - return assemblies; - } - } -#endif -#endregion - -#region "Fluent" API - /// - /// Registration options for "fluent" API - /// - public sealed class RegisterOptions - { - private TinyIoCContainer _Container; - private TypeRegistration _Registration; - - public RegisterOptions(TinyIoCContainer container, TypeRegistration registration) - { - _Container = container; - _Registration = registration; - } - - /// - /// Make registration a singleton (single instance) if possible - /// - /// RegisterOptions - /// - public RegisterOptions AsSingleton() - { - var currentFactory = _Container.GetCurrentFactory(_Registration); - - if (currentFactory == null) - throw new TinyIoCRegistrationException(_Registration.Type, "singleton"); - - return _Container.AddUpdateRegistration(_Registration, currentFactory.SingletonVariant); - } - - /// - /// Make registration multi-instance if possible - /// - /// RegisterOptions - /// - public RegisterOptions AsMultiInstance() - { - var currentFactory = _Container.GetCurrentFactory(_Registration); - - if (currentFactory == null) - throw new TinyIoCRegistrationException(_Registration.Type, "multi-instance"); - - return _Container.AddUpdateRegistration(_Registration, currentFactory.MultiInstanceVariant); - } - - /// - /// Make registration hold a weak reference if possible - /// - /// RegisterOptions - /// - public RegisterOptions WithWeakReference() - { - var currentFactory = _Container.GetCurrentFactory(_Registration); - - if (currentFactory == null) - throw new TinyIoCRegistrationException(_Registration.Type, "weak reference"); - - return _Container.AddUpdateRegistration(_Registration, currentFactory.WeakReferenceVariant); - } - - /// - /// Make registration hold a strong reference if possible - /// - /// RegisterOptions - /// - public RegisterOptions WithStrongReference() - { - var currentFactory = _Container.GetCurrentFactory(_Registration); - - if (currentFactory == null) - throw new TinyIoCRegistrationException(_Registration.Type, "strong reference"); - - return _Container.AddUpdateRegistration(_Registration, currentFactory.StrongReferenceVariant); - } - -#if EXPRESSIONS - public RegisterOptions UsingConstructor(Expression> constructor) - { - var lambda = constructor as LambdaExpression; - if (lambda == null) - throw new TinyIoCConstructorResolutionException(typeof(RegisterType)); - - var newExpression = lambda.Body as NewExpression; - if (newExpression == null) - throw new TinyIoCConstructorResolutionException(typeof(RegisterType)); - - var constructorInfo = newExpression.Constructor; - if (constructorInfo == null) - throw new TinyIoCConstructorResolutionException(typeof(RegisterType)); - - var currentFactory = _Container.GetCurrentFactory(_Registration); - if (currentFactory == null) - throw new TinyIoCConstructorResolutionException(typeof(RegisterType)); - - currentFactory.SetConstructor(constructorInfo); - - return this; - } -#endif - /// - /// Switches to a custom lifetime manager factory if possible. - /// - /// Usually used for RegisterOptions "To*" extension methods such as the ASP.Net per-request one. - /// - /// RegisterOptions instance - /// Custom lifetime manager - /// Error string to display if switch fails - /// RegisterOptions - public static RegisterOptions ToCustomLifetimeManager(RegisterOptions instance, ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString) - { - if (instance == null) - throw new ArgumentNullException("instance", "instance is null."); - - if (lifetimeProvider == null) - throw new ArgumentNullException("lifetimeProvider", "lifetimeProvider is null."); - - if (string.IsNullOrEmpty(errorString)) - throw new ArgumentException("errorString is null or empty.", "errorString"); - - var currentFactory = instance._Container.GetCurrentFactory(instance._Registration); - - if (currentFactory == null) - throw new TinyIoCRegistrationException(instance._Registration.Type, errorString); - - return instance._Container.AddUpdateRegistration(instance._Registration, currentFactory.GetCustomObjectLifetimeVariant(lifetimeProvider, errorString)); - } - } - - /// - /// Registration options for "fluent" API when registering multiple implementations - /// - public sealed class MultiRegisterOptions - { - private IEnumerable _RegisterOptions; - - /// - /// Initializes a new instance of the MultiRegisterOptions class. - /// - /// Registration options - public MultiRegisterOptions(IEnumerable registerOptions) - { - _RegisterOptions = registerOptions; - } - - /// - /// Make registration a singleton (single instance) if possible - /// - /// RegisterOptions - /// - public MultiRegisterOptions AsSingleton() - { - _RegisterOptions = ExecuteOnAllRegisterOptions(ro => ro.AsSingleton()); - return this; - } - - /// - /// Make registration multi-instance if possible - /// - /// MultiRegisterOptions - /// - public MultiRegisterOptions AsMultiInstance() - { - _RegisterOptions = ExecuteOnAllRegisterOptions(ro => ro.AsMultiInstance()); - return this; - } - - /// - /// Switches to a custom lifetime manager factory if possible. - /// - /// Usually used for RegisterOptions "To*" extension methods such as the ASP.Net per-request one. - /// - /// MultiRegisterOptions instance - /// Custom lifetime manager - /// Error string to display if switch fails - /// MultiRegisterOptions - public static MultiRegisterOptions ToCustomLifetimeManager( - MultiRegisterOptions instance, - ITinyIoCObjectLifetimeProvider lifetimeProvider, - string errorString) - { - if (instance == null) - throw new ArgumentNullException("instance", "instance is null."); - - if (lifetimeProvider == null) - throw new ArgumentNullException("lifetimeProvider", "lifetimeProvider is null."); - - if (string.IsNullOrEmpty(errorString)) - throw new ArgumentException("errorString is null or empty.", "errorString"); - - instance._RegisterOptions = instance.ExecuteOnAllRegisterOptions(ro => RegisterOptions.ToCustomLifetimeManager(ro, lifetimeProvider, errorString)); - - return instance; - } - - private IEnumerable ExecuteOnAllRegisterOptions(Func action) - { - var newRegisterOptions = new List(); - - foreach (var registerOption in _RegisterOptions) - { - newRegisterOptions.Add(action(registerOption)); - } - - return newRegisterOptions; - } - } -#endregion - -#region Public API -#region Child Containers - public TinyIoCContainer GetChildContainer() - { - return new TinyIoCContainer(this); - } -#endregion - -#region Registration - /// - /// Attempt to automatically register all non-generic classes and interfaces in the current app domain. - /// - /// If more than one class implements an interface then only one implementation will be registered - /// although no error will be thrown. - /// - public void AutoRegister() - { -#if APPDOMAIN_GETASSEMBLIES - AutoRegisterInternal(AppDomain.CurrentDomain.GetAssemblies().Where(a => !IsIgnoredAssembly(a)), DuplicateImplementationActions.RegisterSingle, null); -#else - AutoRegisterInternal(new Assembly[] { this.GetType().Assembly() }, DuplicateImplementationActions.RegisterSingle, null); -#endif - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the current app domain. - /// Types will only be registered if they pass the supplied registration predicate. - /// - /// If more than one class implements an interface then only one implementation will be registered - /// although no error will be thrown. - /// - /// Predicate to determine if a particular type should be registered - public void AutoRegister(Func registrationPredicate) - { -#if APPDOMAIN_GETASSEMBLIES - AutoRegisterInternal(AppDomain.CurrentDomain.GetAssemblies().Where(a => !IsIgnoredAssembly(a)), DuplicateImplementationActions.RegisterSingle, registrationPredicate); -#else - AutoRegisterInternal(new Assembly[] { this.GetType().Assembly() }, DuplicateImplementationActions.RegisterSingle, registrationPredicate); -#endif - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the current app domain. - /// - /// What action to take when encountering duplicate implementations of an interface/base class. - /// - public void AutoRegister(DuplicateImplementationActions duplicateAction) - { -#if APPDOMAIN_GETASSEMBLIES - AutoRegisterInternal(AppDomain.CurrentDomain.GetAssemblies().Where(a => !IsIgnoredAssembly(a)), duplicateAction, null); -#else - AutoRegisterInternal(new Assembly[] { this.GetType().Assembly() }, duplicateAction, null); -#endif - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the current app domain. - /// Types will only be registered if they pass the supplied registration predicate. - /// - /// What action to take when encountering duplicate implementations of an interface/base class. - /// Predicate to determine if a particular type should be registered - /// - public void AutoRegister(DuplicateImplementationActions duplicateAction, Func registrationPredicate) - { -#if APPDOMAIN_GETASSEMBLIES - AutoRegisterInternal(AppDomain.CurrentDomain.GetAssemblies().Where(a => !IsIgnoredAssembly(a)), duplicateAction, registrationPredicate); -#else - AutoRegisterInternal(new Assembly[] { this.GetType().Assembly() }, duplicateAction, registrationPredicate); -#endif - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies - /// - /// If more than one class implements an interface then only one implementation will be registered - /// although no error will be thrown. - /// - /// Assemblies to process - public void AutoRegister(IEnumerable assemblies) - { - AutoRegisterInternal(assemblies, DuplicateImplementationActions.RegisterSingle, null); - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies - /// Types will only be registered if they pass the supplied registration predicate. - /// - /// If more than one class implements an interface then only one implementation will be registered - /// although no error will be thrown. - /// - /// Assemblies to process - /// Predicate to determine if a particular type should be registered - public void AutoRegister(IEnumerable assemblies, Func registrationPredicate) - { - AutoRegisterInternal(assemblies, DuplicateImplementationActions.RegisterSingle, registrationPredicate); - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies - /// - /// Assemblies to process - /// What action to take when encountering duplicate implementations of an interface/base class. - /// - public void AutoRegister(IEnumerable assemblies, DuplicateImplementationActions duplicateAction) - { - AutoRegisterInternal(assemblies, duplicateAction, null); - } - - /// - /// Attempt to automatically register all non-generic classes and interfaces in the specified assemblies - /// Types will only be registered if they pass the supplied registration predicate. - /// - /// Assemblies to process - /// What action to take when encountering duplicate implementations of an interface/base class. - /// Predicate to determine if a particular type should be registered - /// - public void AutoRegister(IEnumerable assemblies, DuplicateImplementationActions duplicateAction, Func registrationPredicate) - { - AutoRegisterInternal(assemblies, duplicateAction, registrationPredicate); - } - - /// - /// Creates/replaces a container class registration with default options. - /// - /// Type to register - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType) - { - return RegisterInternal(registerType, string.Empty, GetDefaultObjectFactory(registerType, registerType)); - } - - /// - /// Creates/replaces a named container class registration with default options. - /// - /// Type to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, string name) - { - return RegisterInternal(registerType, name, GetDefaultObjectFactory(registerType, registerType)); - - } - - /// - /// Creates/replaces a container class registration with a given implementation and default options. - /// - /// Type to register - /// Type to instantiate that implements RegisterType - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Type registerImplementation) - { - return this.RegisterInternal(registerType, string.Empty, GetDefaultObjectFactory(registerType, registerImplementation)); - } - - /// - /// Creates/replaces a named container class registration with a given implementation and default options. - /// - /// Type to register - /// Type to instantiate that implements RegisterType - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Type registerImplementation, string name) - { - return this.RegisterInternal(registerType, name, GetDefaultObjectFactory(registerType, registerImplementation)); - } - - /// - /// Creates/replaces a container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Instance of RegisterType to register - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, object instance) - { - return RegisterInternal(registerType, string.Empty, new InstanceFactory(registerType, registerType, instance)); - } - - /// - /// Creates/replaces a named container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Instance of RegisterType to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, object instance, string name) - { - return RegisterInternal(registerType, name, new InstanceFactory(registerType, registerType, instance)); - } - - /// - /// Creates/replaces a container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Type of instance to register that implements RegisterType - /// Instance of RegisterImplementation to register - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Type registerImplementation, object instance) - { - return RegisterInternal(registerType, string.Empty, new InstanceFactory(registerType, registerImplementation, instance)); - } - - /// - /// Creates/replaces a named container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Type of instance to register that implements RegisterType - /// Instance of RegisterImplementation to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Type registerImplementation, object instance, string name) - { - return RegisterInternal(registerType, name, new InstanceFactory(registerType, registerImplementation, instance)); - } - - /// - /// Creates/replaces a container class registration with a user specified factory - /// - /// Type to register - /// Factory/lambda that returns an instance of RegisterType - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Func factory) - { - return RegisterInternal(registerType, string.Empty, new DelegateFactory(registerType, factory)); - } - - /// - /// Creates/replaces a container class registration with a user specified factory - /// - /// Type to register - /// Factory/lambda that returns an instance of RegisterType - /// Name of registation - /// RegisterOptions for fluent API - public RegisterOptions Register(Type registerType, Func factory, string name) - { - return RegisterInternal(registerType, name, new DelegateFactory(registerType, factory)); - } - - /// - /// Creates/replaces a container class registration with default options. - /// - /// Type to register - /// RegisterOptions for fluent API - public RegisterOptions Register() - where RegisterType : class - { - return this.Register(typeof(RegisterType)); - } - - /// - /// Creates/replaces a named container class registration with default options. - /// - /// Type to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(string name) - where RegisterType : class - { - return this.Register(typeof(RegisterType), name); - } - - /// - /// Creates/replaces a container class registration with a given implementation and default options. - /// - /// Type to register - /// Type to instantiate that implements RegisterType - /// RegisterOptions for fluent API - public RegisterOptions Register() - where RegisterType : class - where RegisterImplementation : class, RegisterType - { - return this.Register(typeof(RegisterType), typeof(RegisterImplementation)); - } - - /// - /// Creates/replaces a named container class registration with a given implementation and default options. - /// - /// Type to register - /// Type to instantiate that implements RegisterType - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(string name) - where RegisterType : class - where RegisterImplementation : class, RegisterType - { - return this.Register(typeof(RegisterType), typeof(RegisterImplementation), name); - } - - /// - /// Creates/replaces a container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Instance of RegisterType to register - /// RegisterOptions for fluent API - public RegisterOptions Register(RegisterType instance) - where RegisterType : class - { - return this.Register(typeof(RegisterType), instance); - } - - /// - /// Creates/replaces a named container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Instance of RegisterType to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(RegisterType instance, string name) - where RegisterType : class - { - return this.Register(typeof(RegisterType), instance, name); - } - - /// - /// Creates/replaces a container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Type of instance to register that implements RegisterType - /// Instance of RegisterImplementation to register - /// RegisterOptions for fluent API - public RegisterOptions Register(RegisterImplementation instance) - where RegisterType : class - where RegisterImplementation : class, RegisterType - { - return this.Register(typeof(RegisterType), typeof(RegisterImplementation), instance); - } - - /// - /// Creates/replaces a named container class registration with a specific, strong referenced, instance. - /// - /// Type to register - /// Type of instance to register that implements RegisterType - /// Instance of RegisterImplementation to register - /// Name of registration - /// RegisterOptions for fluent API - public RegisterOptions Register(RegisterImplementation instance, string name) - where RegisterType : class - where RegisterImplementation : class, RegisterType - { - return this.Register(typeof(RegisterType), typeof(RegisterImplementation), instance, name); - } - - /// - /// Creates/replaces a container class registration with a user specified factory - /// - /// Type to register - /// Factory/lambda that returns an instance of RegisterType - /// RegisterOptions for fluent API - public RegisterOptions Register(Func factory) - where RegisterType : class - { - if (factory == null) - { - throw new ArgumentNullException("factory"); - } - - return this.Register(typeof(RegisterType), (c, o) => factory(c, o)); - } - - /// - /// Creates/replaces a named container class registration with a user specified factory - /// - /// Type to register - /// Factory/lambda that returns an instance of RegisterType - /// Name of registation - /// RegisterOptions for fluent API - public RegisterOptions Register(Func factory, string name) - where RegisterType : class - { - if (factory == null) - { - throw new ArgumentNullException("factory"); - } - - return this.Register(typeof(RegisterType), (c, o) => factory(c, o), name); - } - - /// - /// Register multiple implementations of a type. - /// - /// Internally this registers each implementation using the full name of the class as its registration name. - /// - /// Type that each implementation implements - /// Types that implement RegisterType - /// MultiRegisterOptions for the fluent API - public MultiRegisterOptions RegisterMultiple(IEnumerable implementationTypes) - { - return RegisterMultiple(typeof(RegisterType), implementationTypes); - } - - /// - /// Register multiple implementations of a type. - /// - /// Internally this registers each implementation using the full name of the class as its registration name. - /// - /// Type that each implementation implements - /// Types that implement RegisterType - /// MultiRegisterOptions for the fluent API - public MultiRegisterOptions RegisterMultiple(Type registrationType, IEnumerable implementationTypes) - { - if (implementationTypes == null) - throw new ArgumentNullException("types", "types is null."); - - foreach (var type in implementationTypes) - //#if NETFX_CORE - // if (!registrationType.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) - //#else - if (!registrationType.IsAssignableFrom(type)) - //#endif - throw new ArgumentException(String.Format("types: The type {0} is not assignable from {1}", registrationType.FullName, type.FullName)); - - if (implementationTypes.Count() != implementationTypes.Distinct().Count()) - { - var queryForDuplicatedTypes = from i in implementationTypes - group i by i - into j - where j.Count() > 1 - select j.Key.FullName; - - var fullNamesOfDuplicatedTypes = string.Join(",\n", queryForDuplicatedTypes.ToArray()); - var multipleRegMessage = string.Format("types: The same implementation type cannot be specified multiple times for {0}\n\n{1}", registrationType.FullName, fullNamesOfDuplicatedTypes); - throw new ArgumentException(multipleRegMessage); - } - - var registerOptions = new List(); - - foreach (var type in implementationTypes) - { - registerOptions.Add(Register(registrationType, type, type.FullName)); - } - - return new MultiRegisterOptions(registerOptions); - } -#endregion - -#region Unregistration - - /// - /// Remove a container class registration. - /// - /// Type to unregister - /// true if the registration is successfully found and removed; otherwise, false. - public bool Unregister() - { - return Unregister(typeof(RegisterType), string.Empty); - } - - /// - /// Remove a named container class registration. - /// - /// Type to unregister - /// Name of registration - /// true if the registration is successfully found and removed; otherwise, false. - public bool Unregister(string name) - { - return Unregister(typeof(RegisterType), name); - } - - /// - /// Remove a container class registration. - /// - /// Type to unregister - /// true if the registration is successfully found and removed; otherwise, false. - public bool Unregister(Type registerType) - { - return Unregister(registerType, string.Empty); - } - - /// - /// Remove a named container class registration. - /// - /// Type to unregister - /// Name of registration - /// true if the registration is successfully found and removed; otherwise, false. - public bool Unregister(Type registerType, string name) - { - var typeRegistration = new TypeRegistration(registerType, name); - - return RemoveRegistration(typeRegistration); - } - -#endregion - -#region Resolution - /// - /// Attempts to resolve a type using default options. - /// - /// Type to resolve - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType) - { - return ResolveInternal(new TypeRegistration(resolveType), NamedParameterOverloads.Default, ResolveOptions.Default); - } - - /// - /// Attempts to resolve a type using specified options. - /// - /// Type to resolve - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, ResolveOptions options) - { - return ResolveInternal(new TypeRegistration(resolveType), NamedParameterOverloads.Default, options); - } - - /// - /// Attempts to resolve a type using default options and the supplied name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, string name) - { - return ResolveInternal(new TypeRegistration(resolveType, name), NamedParameterOverloads.Default, ResolveOptions.Default); - } - - /// - /// Attempts to resolve a type using supplied options and name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, string name, ResolveOptions options) - { - return ResolveInternal(new TypeRegistration(resolveType, name), NamedParameterOverloads.Default, options); - } - - /// - /// Attempts to resolve a type using default options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, NamedParameterOverloads parameters) - { - return ResolveInternal(new TypeRegistration(resolveType), parameters, ResolveOptions.Default); - } - - /// - /// Attempts to resolve a type using specified options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, NamedParameterOverloads parameters, ResolveOptions options) - { - return ResolveInternal(new TypeRegistration(resolveType), parameters, options); - } - - /// - /// Attempts to resolve a type using default options and the supplied constructor parameters and name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Name of registration - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, string name, NamedParameterOverloads parameters) - { - return ResolveInternal(new TypeRegistration(resolveType, name), parameters, ResolveOptions.Default); - } - - /// - /// Attempts to resolve a named type using specified options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public object Resolve(Type resolveType, string name, NamedParameterOverloads parameters, ResolveOptions options) - { - return ResolveInternal(new TypeRegistration(resolveType, name), parameters, options); - } - - /// - /// Attempts to resolve a type using default options. - /// - /// Type to resolve - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve() - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType)); - } - - /// - /// Attempts to resolve a type using specified options. - /// - /// Type to resolve - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(ResolveOptions options) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), options); - } - - /// - /// Attempts to resolve a type using default options and the supplied name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(string name) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), name); - } - - /// - /// Attempts to resolve a type using supplied options and name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(string name, ResolveOptions options) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), name, options); - } - - /// - /// Attempts to resolve a type using default options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(NamedParameterOverloads parameters) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), parameters); - } - - /// - /// Attempts to resolve a type using specified options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(NamedParameterOverloads parameters, ResolveOptions options) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), parameters, options); - } - - /// - /// Attempts to resolve a type using default options and the supplied constructor parameters and name. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// User specified constructor parameters - /// Name of registration - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(string name, NamedParameterOverloads parameters) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), name, parameters); - } - - /// - /// Attempts to resolve a named type using specified options and the supplied constructor parameters. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolution options - /// Instance of type - /// Unable to resolve the type. - public ResolveType Resolve(string name, NamedParameterOverloads parameters, ResolveOptions options) - where ResolveType : class - { - return (ResolveType)Resolve(typeof(ResolveType), name, parameters, options); - } - - /// - /// Attempts to predict whether a given type can be resolved with default options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType) - { - return CanResolveInternal(new TypeRegistration(resolveType), NamedParameterOverloads.Default, ResolveOptions.Default); - } - - /// - /// Attempts to predict whether a given named type can be resolved with default options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// Bool indicating whether the type can be resolved - private bool CanResolve(Type resolveType, string name) - { - return CanResolveInternal(new TypeRegistration(resolveType, name), NamedParameterOverloads.Default, ResolveOptions.Default); - } - - /// - /// Attempts to predict whether a given type can be resolved with the specified options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, ResolveOptions options) - { - return CanResolveInternal(new TypeRegistration(resolveType), NamedParameterOverloads.Default, options); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the specified options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, string name, ResolveOptions options) - { - return CanResolveInternal(new TypeRegistration(resolveType, name), NamedParameterOverloads.Default, options); - } - - /// - /// Attempts to predict whether a given type can be resolved with the supplied constructor parameters and default options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// User supplied named parameter overloads - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, NamedParameterOverloads parameters) - { - return CanResolveInternal(new TypeRegistration(resolveType), parameters, ResolveOptions.Default); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the supplied constructor parameters and default options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// User supplied named parameter overloads - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, string name, NamedParameterOverloads parameters) - { - return CanResolveInternal(new TypeRegistration(resolveType, name), parameters, ResolveOptions.Default); - } - - /// - /// Attempts to predict whether a given type can be resolved with the supplied constructor parameters options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// User supplied named parameter overloads - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, NamedParameterOverloads parameters, ResolveOptions options) - { - return CanResolveInternal(new TypeRegistration(resolveType), parameters, options); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the supplied constructor parameters options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// User supplied named parameter overloads - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(Type resolveType, string name, NamedParameterOverloads parameters, ResolveOptions options) - { - return CanResolveInternal(new TypeRegistration(resolveType, name), parameters, options); - } - - /// - /// Attempts to predict whether a given type can be resolved with default options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Bool indicating whether the type can be resolved - public bool CanResolve() - where ResolveType : class - { - return CanResolve(typeof(ResolveType)); - } - - /// - /// Attempts to predict whether a given named type can be resolved with default options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Bool indicating whether the type can be resolved - public bool CanResolve(string name) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), name); - } - - /// - /// Attempts to predict whether a given type can be resolved with the specified options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(ResolveOptions options) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), options); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the specified options. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(string name, ResolveOptions options) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), name, options); - } - - /// - /// Attempts to predict whether a given type can be resolved with the supplied constructor parameters and default options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// User supplied named parameter overloads - /// Bool indicating whether the type can be resolved - public bool CanResolve(NamedParameterOverloads parameters) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), parameters); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the supplied constructor parameters and default options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// User supplied named parameter overloads - /// Bool indicating whether the type can be resolved - public bool CanResolve(string name, NamedParameterOverloads parameters) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), name, parameters); - } - - /// - /// Attempts to predict whether a given type can be resolved with the supplied constructor parameters options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// User supplied named parameter overloads - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(NamedParameterOverloads parameters, ResolveOptions options) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), parameters, options); - } - - /// - /// Attempts to predict whether a given named type can be resolved with the supplied constructor parameters options. - /// - /// Parameters are used in conjunction with normal container resolution to find the most suitable constructor (if one exists). - /// All user supplied parameters must exist in at least one resolvable constructor of RegisterType or resolution will fail. - /// - /// Note: Resolution may still fail if user defined factory registations fail to construct objects when called. - /// - /// Type to resolve - /// Name of registration - /// User supplied named parameter overloads - /// Resolution options - /// Bool indicating whether the type can be resolved - public bool CanResolve(string name, NamedParameterOverloads parameters, ResolveOptions options) - where ResolveType : class - { - return CanResolve(typeof(ResolveType), name, parameters, options); - } - - /// - /// Attemps to resolve a type using the default options - /// - /// Type to resolve - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the given options - /// - /// Type to resolve - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, ResolveOptions options, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and given name - /// - /// Type to resolve - /// Name of registration - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, string name, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, name); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the given options and name - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, string name, ResolveOptions options, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, name, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and supplied constructor parameters - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, NamedParameterOverloads parameters, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, parameters); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and supplied name and constructor parameters - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, string name, NamedParameterOverloads parameters, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, name, parameters); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the supplied options and constructor parameters - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, NamedParameterOverloads parameters, ResolveOptions options, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, parameters, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the supplied name, options and constructor parameters - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(Type resolveType, string name, NamedParameterOverloads parameters, ResolveOptions options, out object resolvedType) - { - try - { - resolvedType = Resolve(resolveType, name, parameters, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = null; - return false; - } - } - - /// - /// Attemps to resolve a type using the default options - /// - /// Type to resolve - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the given options - /// - /// Type to resolve - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(ResolveOptions options, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and given name - /// - /// Type to resolve - /// Name of registration - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(string name, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(name); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the given options and name - /// - /// Type to resolve - /// Name of registration - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(string name, ResolveOptions options, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(name, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and supplied constructor parameters - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(NamedParameterOverloads parameters, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(parameters); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the default options and supplied name and constructor parameters - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(string name, NamedParameterOverloads parameters, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(name, parameters); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the supplied options and constructor parameters - /// - /// Type to resolve - /// User specified constructor parameters - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(NamedParameterOverloads parameters, ResolveOptions options, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(parameters, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Attemps to resolve a type using the supplied name, options and constructor parameters - /// - /// Type to resolve - /// Name of registration - /// User specified constructor parameters - /// Resolution options - /// Resolved type or default if resolve fails - /// True if resolved sucessfully, false otherwise - public bool TryResolve(string name, NamedParameterOverloads parameters, ResolveOptions options, out ResolveType resolvedType) - where ResolveType : class - { - try - { - resolvedType = Resolve(name, parameters, options); - return true; - } - catch (TinyIoCResolutionException) - { - resolvedType = default(ResolveType); - return false; - } - } - - /// - /// Returns all registrations of a type - /// - /// Type to resolveAll - /// Whether to include un-named (default) registrations - /// IEnumerable - public IEnumerable ResolveAll(Type resolveType, bool includeUnnamed) - { - return ResolveAllInternal(resolveType, includeUnnamed); - } - - /// - /// Returns all registrations of a type, both named and unnamed - /// - /// Type to resolveAll - /// IEnumerable - public IEnumerable ResolveAll(Type resolveType) - { - return ResolveAll(resolveType, false); - } - - /// - /// Returns all registrations of a type - /// - /// Type to resolveAll - /// Whether to include un-named (default) registrations - /// IEnumerable - public IEnumerable ResolveAll(bool includeUnnamed) - where ResolveType : class - { - return this.ResolveAll(typeof(ResolveType), includeUnnamed).Cast(); - } - - /// - /// Returns all registrations of a type, both named and unnamed - /// - /// Type to resolveAll - /// IEnumerable - public IEnumerable ResolveAll() - where ResolveType : class - { - return ResolveAll(true); - } - - /// - /// Attempts to resolve all public property dependencies on the given object. - /// - /// Object to "build up" - public void BuildUp(object input) - { - BuildUpInternal(input, ResolveOptions.Default); - } - - /// - /// Attempts to resolve all public property dependencies on the given object using the given resolve options. - /// - /// Object to "build up" - /// Resolve options to use - public void BuildUp(object input, ResolveOptions resolveOptions) - { - BuildUpInternal(input, resolveOptions); - } -#endregion -#endregion - -#region Object Factories - /// - /// Provides custom lifetime management for ASP.Net per-request lifetimes etc. - /// - public interface ITinyIoCObjectLifetimeProvider - { - /// - /// Gets the stored object if it exists, or null if not - /// - /// Object instance or null - object GetObject(); - - /// - /// Store the object - /// - /// Object to store - void SetObject(object value); - - /// - /// Release the object - /// - void ReleaseObject(); - } - - private abstract class ObjectFactoryBase - { - /// - /// Whether to assume this factory sucessfully constructs its objects - /// - /// Generally set to true for delegate style factories as CanResolve cannot delve - /// into the delegates they contain. - /// - public virtual bool AssumeConstruction { get { return false; } } - - /// - /// The type the factory instantiates - /// - public abstract Type CreatesType { get; } - - /// - /// Constructor to use, if specified - /// - public ConstructorInfo Constructor { get; protected set; } - - /// - /// Create the type - /// - /// Type user requested to be resolved - /// Container that requested the creation - /// Any user parameters passed - /// - /// - public abstract object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options); - - public virtual ObjectFactoryBase SingletonVariant - { - get - { - throw new TinyIoCRegistrationException(this.GetType(), "singleton"); - } - } - - public virtual ObjectFactoryBase MultiInstanceVariant - { - get - { - throw new TinyIoCRegistrationException(this.GetType(), "multi-instance"); - } - } - - public virtual ObjectFactoryBase StrongReferenceVariant - { - get - { - throw new TinyIoCRegistrationException(this.GetType(), "strong reference"); - } - } - - public virtual ObjectFactoryBase WeakReferenceVariant - { - get - { - throw new TinyIoCRegistrationException(this.GetType(), "weak reference"); - } - } - - public virtual ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString) - { - throw new TinyIoCRegistrationException(this.GetType(), errorString); - } - - public virtual void SetConstructor(ConstructorInfo constructor) - { - Constructor = constructor; - } - - public virtual ObjectFactoryBase GetFactoryForChildContainer(Type type, TinyIoCContainer parent, TinyIoCContainer child) - { - return this; - } - } - - /// - /// IObjectFactory that creates new instances of types for each resolution - /// - private class MultiInstanceFactory : ObjectFactoryBase - { - private readonly Type registerType; - private readonly Type registerImplementation; - public override Type CreatesType { get { return this.registerImplementation; } } - - public MultiInstanceFactory(Type registerType, Type registerImplementation) - { - //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) - // throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); - //#else - if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) - throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); - //#endif - if (!IsValidAssignment(registerType, registerImplementation)) - throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); - - this.registerType = registerType; - this.registerImplementation = registerImplementation; - } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - try - { - return container.ConstructType(requestedType, this.registerImplementation, Constructor, parameters, options); - } - catch (TinyIoCResolutionException ex) - { - throw new TinyIoCResolutionException(this.registerType, ex); - } - } - - public override ObjectFactoryBase SingletonVariant - { - get - { - return new SingletonFactory(this.registerType, this.registerImplementation); - } - } - - public override ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString) - { - return new CustomObjectLifetimeFactory(this.registerType, this.registerImplementation, lifetimeProvider, errorString); - } - - public override ObjectFactoryBase MultiInstanceVariant - { - get - { - return this; - } - } - } - - /// - /// IObjectFactory that invokes a specified delegate to construct the object - /// - private class DelegateFactory : ObjectFactoryBase - { - private readonly Type registerType; - - private Func _factory; - - public override bool AssumeConstruction { get { return true; } } - - public override Type CreatesType { get { return this.registerType; } } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - try - { - return _factory.Invoke(container, parameters); - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(this.registerType, ex); - } - } - - public DelegateFactory(Type registerType, Func factory) - { - if (factory == null) - throw new ArgumentNullException("factory"); - - _factory = factory; - - this.registerType = registerType; - } - - public override ObjectFactoryBase WeakReferenceVariant - { - get - { - return new WeakDelegateFactory(this.registerType, _factory); - } - } - - public override ObjectFactoryBase StrongReferenceVariant - { - get - { - return this; - } - } - - public override void SetConstructor(ConstructorInfo constructor) - { - throw new TinyIoCConstructorResolutionException("Constructor selection is not possible for delegate factory registrations"); - } - } - - /// - /// IObjectFactory that invokes a specified delegate to construct the object - /// Holds the delegate using a weak reference - /// - private class WeakDelegateFactory : ObjectFactoryBase - { - private readonly Type registerType; - - private WeakReference _factory; - - public override bool AssumeConstruction { get { return true; } } - - public override Type CreatesType { get { return this.registerType; } } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - var factory = _factory.Target as Func; - - if (factory == null) - throw new TinyIoCWeakReferenceException(this.registerType); - - try - { - return factory.Invoke(container, parameters); - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(this.registerType, ex); - } - } - - public WeakDelegateFactory(Type registerType, Func factory) - { - if (factory == null) - throw new ArgumentNullException("factory"); - - _factory = new WeakReference(factory); - - this.registerType = registerType; - } - - public override ObjectFactoryBase StrongReferenceVariant - { - get - { - var factory = _factory.Target as Func; - - if (factory == null) - throw new TinyIoCWeakReferenceException(this.registerType); - - return new DelegateFactory(this.registerType, factory); - } - } - - public override ObjectFactoryBase WeakReferenceVariant - { - get - { - return this; - } - } - - public override void SetConstructor(ConstructorInfo constructor) - { - throw new TinyIoCConstructorResolutionException("Constructor selection is not possible for delegate factory registrations"); - } - } - - /// - /// Stores an particular instance to return for a type - /// - private class InstanceFactory : ObjectFactoryBase, IDisposable - { - private readonly Type registerType; - private readonly Type registerImplementation; - private object _instance; - - public override bool AssumeConstruction { get { return true; } } - - public InstanceFactory(Type registerType, Type registerImplementation, object instance) - { - if (!IsValidAssignment(registerType, registerImplementation)) - throw new TinyIoCRegistrationTypeException(registerImplementation, "InstanceFactory"); - - this.registerType = registerType; - this.registerImplementation = registerImplementation; - _instance = instance; - } - - public override Type CreatesType - { - get { return this.registerImplementation; } - } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - return _instance; - } - - public override ObjectFactoryBase MultiInstanceVariant - { - get { return new MultiInstanceFactory(this.registerType, this.registerImplementation); } - } - - public override ObjectFactoryBase WeakReferenceVariant - { - get - { - return new WeakInstanceFactory(this.registerType, this.registerImplementation, this._instance); - } - } - - public override ObjectFactoryBase StrongReferenceVariant - { - get - { - return this; - } - } - - public override void SetConstructor(ConstructorInfo constructor) - { - throw new TinyIoCConstructorResolutionException("Constructor selection is not possible for instance factory registrations"); - } - - public void Dispose() - { - var disposable = _instance as IDisposable; - - if (disposable != null) - disposable.Dispose(); - } - } - - /// - /// Stores an particular instance to return for a type - /// - /// Stores the instance with a weak reference - /// - private class WeakInstanceFactory : ObjectFactoryBase, IDisposable - { - private readonly Type registerType; - private readonly Type registerImplementation; - private readonly WeakReference _instance; - - public WeakInstanceFactory(Type registerType, Type registerImplementation, object instance) - { - if (!IsValidAssignment(registerType, registerImplementation)) - throw new TinyIoCRegistrationTypeException(registerImplementation, "WeakInstanceFactory"); - - this.registerType = registerType; - this.registerImplementation = registerImplementation; - _instance = new WeakReference(instance); - } - - public override Type CreatesType - { - get { return this.registerImplementation; } - } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - var instance = _instance.Target; - - if (instance == null) - throw new TinyIoCWeakReferenceException(this.registerType); - - return instance; - } - - public override ObjectFactoryBase MultiInstanceVariant - { - get - { - return new MultiInstanceFactory(this.registerType, this.registerImplementation); - } - } - - public override ObjectFactoryBase WeakReferenceVariant - { - get - { - return this; - } - } - - public override ObjectFactoryBase StrongReferenceVariant - { - get - { - var instance = _instance.Target; - - if (instance == null) - throw new TinyIoCWeakReferenceException(this.registerType); - - return new InstanceFactory(this.registerType, this.registerImplementation, instance); - } - } - - public override void SetConstructor(ConstructorInfo constructor) - { - throw new TinyIoCConstructorResolutionException("Constructor selection is not possible for instance factory registrations"); - } - - public void Dispose() - { - var disposable = _instance.Target as IDisposable; - - if (disposable != null) - disposable.Dispose(); - } - } - - /// - /// A factory that lazy instantiates a type and always returns the same instance - /// - private class SingletonFactory : ObjectFactoryBase, IDisposable - { - private readonly Type registerType; - private readonly Type registerImplementation; - private readonly object SingletonLock = new object(); - private object _Current; - - public SingletonFactory(Type registerType, Type registerImplementation) - { - //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) - //#else - if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) - //#endif - throw new TinyIoCRegistrationTypeException(registerImplementation, "SingletonFactory"); - - if (!IsValidAssignment(registerType, registerImplementation)) - throw new TinyIoCRegistrationTypeException(registerImplementation, "SingletonFactory"); - - this.registerType = registerType; - this.registerImplementation = registerImplementation; - } - - public override Type CreatesType - { - get { return this.registerImplementation; } - } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - if (parameters.Count != 0) - throw new ArgumentException("Cannot specify parameters for singleton types"); - - lock (SingletonLock) - if (_Current == null) - _Current = container.ConstructType(requestedType, this.registerImplementation, Constructor, options); - - return _Current; - } - - public override ObjectFactoryBase SingletonVariant - { - get - { - return this; - } - } - - public override ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString) - { - return new CustomObjectLifetimeFactory(this.registerType, this.registerImplementation, lifetimeProvider, errorString); - } - - public override ObjectFactoryBase MultiInstanceVariant - { - get - { - return new MultiInstanceFactory(this.registerType, this.registerImplementation); - } - } - - public override ObjectFactoryBase GetFactoryForChildContainer(Type type, TinyIoCContainer parent, TinyIoCContainer child) - { - // We make sure that the singleton is constructed before the child container takes the factory. - // Otherwise the results would vary depending on whether or not the parent container had resolved - // the type before the child container does. - GetObject(type, parent, NamedParameterOverloads.Default, ResolveOptions.Default); - return this; - } - - public void Dispose() - { - if (this._Current == null) - return; - - var disposable = this._Current as IDisposable; - - if (disposable != null) - disposable.Dispose(); - } - } - - /// - /// A factory that offloads lifetime to an external lifetime provider - /// - private class CustomObjectLifetimeFactory : ObjectFactoryBase, IDisposable - { - private readonly object SingletonLock = new object(); - private readonly Type registerType; - private readonly Type registerImplementation; - private readonly ITinyIoCObjectLifetimeProvider _LifetimeProvider; - - public CustomObjectLifetimeFactory(Type registerType, Type registerImplementation, ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorMessage) - { - if (lifetimeProvider == null) - throw new ArgumentNullException("lifetimeProvider", "lifetimeProvider is null."); - - if (!IsValidAssignment(registerType, registerImplementation)) - throw new TinyIoCRegistrationTypeException(registerImplementation, "SingletonFactory"); - - //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) - //#else - if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) - //#endif - throw new TinyIoCRegistrationTypeException(registerImplementation, errorMessage); - - this.registerType = registerType; - this.registerImplementation = registerImplementation; - _LifetimeProvider = lifetimeProvider; - } - - public override Type CreatesType - { - get { return this.registerImplementation; } - } - - public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options) - { - object current; - - lock (SingletonLock) - { - current = _LifetimeProvider.GetObject(); - if (current == null) - { - current = container.ConstructType(requestedType, this.registerImplementation, Constructor, options); - _LifetimeProvider.SetObject(current); - } - } - - return current; - } - - public override ObjectFactoryBase SingletonVariant - { - get - { - _LifetimeProvider.ReleaseObject(); - return new SingletonFactory(this.registerType, this.registerImplementation); - } - } - - public override ObjectFactoryBase MultiInstanceVariant - { - get - { - _LifetimeProvider.ReleaseObject(); - return new MultiInstanceFactory(this.registerType, this.registerImplementation); - } - } - - public override ObjectFactoryBase GetCustomObjectLifetimeVariant(ITinyIoCObjectLifetimeProvider lifetimeProvider, string errorString) - { - _LifetimeProvider.ReleaseObject(); - return new CustomObjectLifetimeFactory(this.registerType, this.registerImplementation, lifetimeProvider, errorString); - } - - public override ObjectFactoryBase GetFactoryForChildContainer(Type type, TinyIoCContainer parent, TinyIoCContainer child) - { - // We make sure that the singleton is constructed before the child container takes the factory. - // Otherwise the results would vary depending on whether or not the parent container had resolved - // the type before the child container does. - GetObject(type, parent, NamedParameterOverloads.Default, ResolveOptions.Default); - return this; - } - - public void Dispose() - { - _LifetimeProvider.ReleaseObject(); - } - } -#endregion - -#region Singleton Container - private static readonly TinyIoCContainer _Current = new TinyIoCContainer(); - - static TinyIoCContainer() - { - } - - /// - /// Lazy created Singleton instance of the container for simple scenarios - /// - public static TinyIoCContainer Current - { - get - { - return _Current; - } - } -#endregion - -#region Type Registrations - public sealed class TypeRegistration - { - private int _hashCode; - - public Type Type { get; private set; } - public string Name { get; private set; } - - public TypeRegistration(Type type) - : this(type, string.Empty) - { - } - - public TypeRegistration(Type type, string name) - { - Type = type; - Name = name; - - _hashCode = String.Concat(Type.FullName, "|", Name).GetHashCode(); - } - - public override bool Equals(object obj) - { - var typeRegistration = obj as TypeRegistration; - - if (typeRegistration == null) - return false; - - if (Type != typeRegistration.Type) - return false; - - if (String.Compare(Name, typeRegistration.Name, StringComparison.Ordinal) != 0) - return false; - - return true; - } - - public override int GetHashCode() - { - return _hashCode; - } - } - private readonly SafeDictionary _RegisteredTypes; -#if USE_OBJECT_CONSTRUCTOR - private delegate object ObjectConstructor(params object[] parameters); - private static readonly SafeDictionary _ObjectConstructorCache = new SafeDictionary(); -#endif -#endregion - -#region Constructors - public TinyIoCContainer() - { - _RegisteredTypes = new SafeDictionary(); - - RegisterDefaultTypes(); - } - - TinyIoCContainer _Parent; - private TinyIoCContainer(TinyIoCContainer parent) - : this() - { - _Parent = parent; - } -#endregion - -#region Internal Methods - private readonly object _AutoRegisterLock = new object(); - private void AutoRegisterInternal(IEnumerable assemblies, DuplicateImplementationActions duplicateAction, Func registrationPredicate) - { - lock (_AutoRegisterLock) - { - var types = assemblies.SelectMany(a => a.SafeGetTypes()).Where(t => !IsIgnoredType(t, registrationPredicate)).ToList(); - - var concreteTypes = types - .Where(type => type.IsClass() && (type.IsAbstract() == false) && (type != this.GetType() && (type.DeclaringType != this.GetType()) && (!type.IsGenericTypeDefinition()))) - .ToList(); - - foreach (var type in concreteTypes) - { - try - { - RegisterInternal(type, string.Empty, GetDefaultObjectFactory(type, type)); - } -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 - catch (MemberAccessException) -#else - catch (MethodAccessException) -#endif - { - // Ignore methods we can't access - added for Silverlight - } - } - - var abstractInterfaceTypes = from type in types - where ((type.IsInterface() || type.IsAbstract()) && (type.DeclaringType != this.GetType()) && (!type.IsGenericTypeDefinition())) - select type; - - foreach (var type in abstractInterfaceTypes) - { - var localType = type; - var implementations = from implementationType in concreteTypes - where localType.IsAssignableFrom(implementationType) - select implementationType; - - if (implementations.Skip(1).Any()) - { - if (duplicateAction == DuplicateImplementationActions.Fail) - throw new TinyIoCAutoRegistrationException(type, implementations); - - if (duplicateAction == DuplicateImplementationActions.RegisterMultiple) - { - RegisterMultiple(type, implementations); - } - } - - var firstImplementation = implementations.FirstOrDefault(); - if (firstImplementation != null) - { - try - { - RegisterInternal(type, string.Empty, GetDefaultObjectFactory(type, firstImplementation)); - } -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 - catch (MemberAccessException) -#else - catch (MethodAccessException) -#endif - { - // Ignore methods we can't access - added for Silverlight - } - } - } - } - } - - private bool IsIgnoredAssembly(Assembly assembly) - { - // TODO - find a better way to remove "system" assemblies from the auto registration - var ignoreChecks = new List>() - { - asm => asm.FullName.StartsWith("Microsoft.", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("System.", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("System,", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("CR_ExtUnitTest", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("mscorlib,", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("CR_VSTest", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("DevExpress.CodeRush", StringComparison.Ordinal), - asm => asm.FullName.StartsWith("xunit.", StringComparison.Ordinal), - }; - - foreach (var check in ignoreChecks) - { - if (check(assembly)) - return true; - } - - return false; - } - - private bool IsIgnoredType(Type type, Func registrationPredicate) - { - // TODO - find a better way to remove "system" types from the auto registration - var ignoreChecks = new List>() - { - t => t.FullName.StartsWith("System.", StringComparison.Ordinal), - t => t.FullName.StartsWith("Microsoft.", StringComparison.Ordinal), - t => t.IsPrimitive(), -#if !UNBOUND_GENERICS_GETCONSTRUCTORS - t => t.IsGenericTypeDefinition(), -#endif - t => (t.GetConstructors(BindingFlags.Instance | BindingFlags.Public).Length == 0) && !(t.IsInterface() || t.IsAbstract()), - }; - - if (registrationPredicate != null) - { - ignoreChecks.Add(t => !registrationPredicate(t)); - } - - foreach (var check in ignoreChecks) - { - if (check(type)) - return true; - } - - return false; - } - - private void RegisterDefaultTypes() - { - Register(this); - -#if TINYMESSENGER - // Only register the TinyMessenger singleton if we are the root container - if (_Parent == null) - Register(); -#endif - } - - private ObjectFactoryBase GetCurrentFactory(TypeRegistration registration) - { - ObjectFactoryBase current = null; - - _RegisteredTypes.TryGetValue(registration, out current); - - return current; - } - - private RegisterOptions RegisterInternal(Type registerType, string name, ObjectFactoryBase factory) - { - var typeRegistration = new TypeRegistration(registerType, name); - - return AddUpdateRegistration(typeRegistration, factory); - } - - private RegisterOptions AddUpdateRegistration(TypeRegistration typeRegistration, ObjectFactoryBase factory) - { - _RegisteredTypes[typeRegistration] = factory; - - return new RegisterOptions(this, typeRegistration); - } - - private bool RemoveRegistration(TypeRegistration typeRegistration) - { - return _RegisteredTypes.Remove(typeRegistration); - } - - private ObjectFactoryBase GetDefaultObjectFactory(Type registerType, Type registerImplementation) - { - //#if NETFX_CORE - // if (registerType.GetTypeInfo().IsInterface() || registerType.GetTypeInfo().IsAbstract()) - //#else - if (registerType.IsInterface() || registerType.IsAbstract()) - //#endif - return new SingletonFactory(registerType, registerImplementation); - - return new MultiInstanceFactory(registerType, registerImplementation); - } - - private bool CanResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) - { - if (parameters == null) - throw new ArgumentNullException("parameters"); - - Type checkType = registration.Type; - string name = registration.Name; - - ObjectFactoryBase factory; - if (_RegisteredTypes.TryGetValue(new TypeRegistration(checkType, name), out factory)) - { - if (factory.AssumeConstruction) - return true; - - if (factory.Constructor == null) - return (GetBestConstructor(factory.CreatesType, parameters, options) != null) ? true : false; - else - return CanConstruct(factory.Constructor, parameters, options); - } - -#if RESOLVE_OPEN_GENERICS - if (checkType.IsInterface() && checkType.IsGenericType()) - { - // if the type is registered as an open generic, then see if the open generic is registered - if (_RegisteredTypes.TryGetValue(new TypeRegistration(checkType.GetGenericTypeDefinition(), name), out factory)) - { - if (factory.AssumeConstruction) - return true; - - if (factory.Constructor == null) - return (GetBestConstructor(factory.CreatesType, parameters, options) != null) ? true : false; - else - return CanConstruct(factory.Constructor, parameters, options); - } - } -#endif - - // Fail if requesting named resolution and settings set to fail if unresolved - // Or bubble up if we have a parent - if (!string.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) - return (_Parent != null) ? _Parent.CanResolveInternal(registration, parameters, options) : false; - - // Attemped unnamed fallback container resolution if relevant and requested - if (!string.IsNullOrEmpty(name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) - { - if (_RegisteredTypes.TryGetValue(new TypeRegistration(checkType), out factory)) - { - if (factory.AssumeConstruction) - return true; - - return (GetBestConstructor(factory.CreatesType, parameters, options) != null) ? true : false; - } - } - - // Check if type is an automatic lazy factory request - if (IsAutomaticLazyFactoryRequest(checkType)) - return true; - - // Check if type is an IEnumerable - if (IsIEnumerableRequest(registration.Type)) - return true; - - // Attempt unregistered construction if possible and requested - // If we cant', bubble if we have a parent - if ((options.UnregisteredResolutionAction == UnregisteredResolutionActions.AttemptResolve) || (checkType.IsGenericType() && options.UnregisteredResolutionAction == UnregisteredResolutionActions.GenericsOnly)) - return (GetBestConstructor(checkType, parameters, options) != null) ? true : (_Parent != null) ? _Parent.CanResolveInternal(registration, parameters, options) : false; - - // Bubble resolution up the container tree if we have a parent - if (_Parent != null) - return _Parent.CanResolveInternal(registration, parameters, options); - - return false; - } - - private bool IsIEnumerableRequest(Type type) - { - if (!type.IsGenericType()) - return false; - - Type genericType = type.GetGenericTypeDefinition(); - - if (genericType == typeof(IEnumerable<>)) - return true; - - return false; - } - - private bool IsAutomaticLazyFactoryRequest(Type type) - { - if (!type.IsGenericType()) - return false; - - Type genericType = type.GetGenericTypeDefinition(); - - // Just a func - if (genericType == typeof(Func<>)) - return true; - - // 2 parameter func with string as first parameter (name) - //#if NETFX_CORE - // if ((genericType == typeof(Func<,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string))) - //#else - if ((genericType == typeof(Func<,>) && type.GetGenericArguments()[0] == typeof(string))) - //#endif - return true; - - // 3 parameter func with string as first parameter (name) and IDictionary as second (parameters) - //#if NETFX_CORE - // if ((genericType == typeof(Func<,,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string) && type.GetTypeInfo().GenericTypeArguments[1] == typeof(IDictionary))) - //#else - if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) - //#endif - return true; - - return false; - } - - private ObjectFactoryBase GetParentObjectFactory(TypeRegistration registration) - { - if (_Parent == null) - return null; - - ObjectFactoryBase factory; - if (_Parent._RegisteredTypes.TryGetValue(registration, out factory)) - { - return factory.GetFactoryForChildContainer(registration.Type, _Parent, this); - } - - return _Parent.GetParentObjectFactory(registration); - } - - private object ResolveInternal(TypeRegistration registration, NamedParameterOverloads parameters, ResolveOptions options) - { - ObjectFactoryBase factory; - - // Attempt container resolution - if (_RegisteredTypes.TryGetValue(registration, out factory)) - { - try - { - return factory.GetObject(registration.Type, this, parameters, options); - } - catch (TinyIoCResolutionException) - { - throw; - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(registration.Type, ex); - } - } - -#if RESOLVE_OPEN_GENERICS - // Attempt container resolution of open generic - if (registration.Type.IsGenericType()) - { - var openTypeRegistration = new TypeRegistration(registration.Type.GetGenericTypeDefinition(), - registration.Name); - - if (_RegisteredTypes.TryGetValue(openTypeRegistration, out factory)) - { - try - { - return factory.GetObject(registration.Type, this, parameters, options); - } - catch (TinyIoCResolutionException) - { - throw; - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(registration.Type, ex); - } - } - } -#endif - - // Attempt to get a factory from parent if we can - var bubbledObjectFactory = GetParentObjectFactory(registration); - if (bubbledObjectFactory != null) - { - try - { - return bubbledObjectFactory.GetObject(registration.Type, this, parameters, options); - } - catch (TinyIoCResolutionException) - { - throw; - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(registration.Type, ex); - } - } - - // Fail if requesting named resolution and settings set to fail if unresolved - if (!string.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.Fail) - throw new TinyIoCResolutionException(registration.Type); - - // Attemped unnamed fallback container resolution if relevant and requested - if (!string.IsNullOrEmpty(registration.Name) && options.NamedResolutionFailureAction == NamedResolutionFailureActions.AttemptUnnamedResolution) - { - if (_RegisteredTypes.TryGetValue(new TypeRegistration(registration.Type, string.Empty), out factory)) - { - try - { - return factory.GetObject(registration.Type, this, parameters, options); - } - catch (TinyIoCResolutionException) - { - throw; - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(registration.Type, ex); - } - } - } - -#if EXPRESSIONS - // Attempt to construct an automatic lazy factory if possible - if (IsAutomaticLazyFactoryRequest(registration.Type)) - return GetLazyAutomaticFactoryRequest(registration.Type); -#endif - if (IsIEnumerableRequest(registration.Type)) - return GetIEnumerableRequest(registration.Type); - - // Attempt unregistered construction if possible and requested - if ((options.UnregisteredResolutionAction == UnregisteredResolutionActions.AttemptResolve) || (registration.Type.IsGenericType() && options.UnregisteredResolutionAction == UnregisteredResolutionActions.GenericsOnly)) - { - if (!registration.Type.IsAbstract() && !registration.Type.IsInterface()) - return ConstructType(null, registration.Type, parameters, options); - } - - // Unable to resolve - throw - throw new TinyIoCResolutionException(registration.Type); - } - -#if EXPRESSIONS - private object GetLazyAutomaticFactoryRequest(Type type) - { - if (!type.IsGenericType()) - return null; - - Type genericType = type.GetGenericTypeDefinition(); - //#if NETFX_CORE - // Type[] genericArguments = type.GetTypeInfo().GenericTypeArguments.ToArray(); - //#else - Type[] genericArguments = type.GetGenericArguments(); - //#endif - - // Just a func - if (genericType == typeof(Func<>)) - { - Type returnType = genericArguments[0]; - - //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => !mi.GetParameters().Any()); - //#else - MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { }); - //#endif - resolveMethod = resolveMethod.MakeGenericMethod(returnType); - - var resolveCall = Expression.Call(Expression.Constant(this), resolveMethod); - - var resolveLambda = Expression.Lambda(resolveCall).Compile(); - - return resolveLambda; - } - - // 2 parameter func with string as first parameter (name) - if ((genericType == typeof(Func<,>)) && (genericArguments[0] == typeof(string))) - { - Type returnType = genericArguments[1]; - - //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 1 && mi.GetParameters()[0].GetType() == typeof(String)); - //#else - MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(String) }); - //#endif - resolveMethod = resolveMethod.MakeGenericMethod(returnType); - - ParameterExpression[] resolveParameters = new ParameterExpression[] { Expression.Parameter(typeof(String), "name") }; - var resolveCall = Expression.Call(Expression.Constant(this), resolveMethod, resolveParameters); - - var resolveLambda = Expression.Lambda(resolveCall, resolveParameters).Compile(); - - return resolveLambda; - } - - // 3 parameter func with string as first parameter (name) and IDictionary as second (parameters) - //#if NETFX_CORE - // if ((genericType == typeof(Func<,,>) && type.GenericTypeArguments[0] == typeof(string) && type.GenericTypeArguments[1] == typeof(IDictionary))) - //#else - if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) - //#endif - { - Type returnType = genericArguments[2]; - - var name = Expression.Parameter(typeof(string), "name"); - var parameters = Expression.Parameter(typeof(IDictionary), "parameters"); - - //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 2 && mi.GetParameters()[0].GetType() == typeof(String) && mi.GetParameters()[1].GetType() == typeof(NamedParameterOverloads)); - //#else - MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(String), typeof(NamedParameterOverloads) }); - //#endif - resolveMethod = resolveMethod.MakeGenericMethod(returnType); - - var resolveCall = Expression.Call(Expression.Constant(this), resolveMethod, name, Expression.Call(typeof(NamedParameterOverloads), "FromIDictionary", null, parameters)); - - var resolveLambda = Expression.Lambda(resolveCall, name, parameters).Compile(); - - return resolveLambda; - } - - throw new TinyIoCResolutionException(type); - } -#endif - private object GetIEnumerableRequest(Type type) - { - //#if NETFX_CORE - // var genericResolveAllMethod = this.GetType().GetGenericMethod("ResolveAll", type.GenericTypeArguments, new[] { typeof(bool) }); - //#else - var genericResolveAllMethod = this.GetType().GetGenericMethod(BindingFlags.Public | BindingFlags.Instance, "ResolveAll", type.GetGenericArguments(), new[] { typeof(bool) }); - //#endif - - return genericResolveAllMethod.Invoke(this, new object[] { false }); - } - - private bool CanConstruct(ConstructorInfo ctor, NamedParameterOverloads parameters, ResolveOptions options) - { - if (parameters == null) - throw new ArgumentNullException("parameters"); - - foreach (var parameter in ctor.GetParameters()) - { - if (string.IsNullOrEmpty(parameter.Name)) - return false; - - var isParameterOverload = parameters.ContainsKey(parameter.Name); - - //#if NETFX_CORE - // if (parameter.ParameterType.GetTypeInfo().IsPrimitive && !isParameterOverload) - //#else - if (parameter.ParameterType.IsPrimitive() && !isParameterOverload) - //#endif - return false; - - if (!isParameterOverload && !CanResolveInternal(new TypeRegistration(parameter.ParameterType), NamedParameterOverloads.Default, options)) - return false; - } - - return true; - } - - private ConstructorInfo GetBestConstructor(Type type, NamedParameterOverloads parameters, ResolveOptions options) - { - if (parameters == null) - throw new ArgumentNullException("parameters"); - - //#if NETFX_CORE - // if (type.GetTypeInfo().IsValueType) - //#else - if (type.IsValueType()) - //#endif - return null; - - // Get constructors in reverse order based on the number of parameters - // i.e. be as "greedy" as possible so we satify the most amount of dependencies possible - var ctors = this.GetTypeConstructors(type); - - foreach (var ctor in ctors) - { - if (this.CanConstruct(ctor, parameters, options)) - return ctor; - } - - return null; - } - - private IEnumerable GetTypeConstructors(Type type) - { - //#if NETFX_CORE - // return type.GetTypeInfo().DeclaredConstructors.OrderByDescending(ctor => ctor.GetParameters().Count()); - //#else - return type.GetConstructors().OrderByDescending(ctor => ctor.GetParameters().Count()); - //#endif - } - - private object ConstructType(Type requestedType, Type implementationType, ResolveOptions options) - { - return ConstructType(requestedType, implementationType, null, NamedParameterOverloads.Default, options); - } - - private object ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, ResolveOptions options) - { - return ConstructType(requestedType, implementationType, constructor, NamedParameterOverloads.Default, options); - } - - private object ConstructType(Type requestedType, Type implementationType, NamedParameterOverloads parameters, ResolveOptions options) - { - return ConstructType(requestedType, implementationType, null, parameters, options); - } - - private object ConstructType(Type requestedType, Type implementationType, ConstructorInfo constructor, NamedParameterOverloads parameters, ResolveOptions options) - { - var typeToConstruct = implementationType; - -#if RESOLVE_OPEN_GENERICS - if (implementationType.IsGenericTypeDefinition()) - { - if (requestedType == null || !requestedType.IsGenericType() || !requestedType.GetGenericArguments().Any()) - throw new TinyIoCResolutionException(typeToConstruct); - - typeToConstruct = typeToConstruct.MakeGenericType(requestedType.GetGenericArguments()); - } -#endif - if (constructor == null) - { - // Try and get the best constructor that we can construct - // if we can't construct any then get the constructor - // with the least number of parameters so we can throw a meaningful - // resolve exception - constructor = GetBestConstructor(typeToConstruct, parameters, options) ?? GetTypeConstructors(typeToConstruct).LastOrDefault(); - } - - if (constructor == null) - throw new TinyIoCResolutionException(typeToConstruct); - - var ctorParams = constructor.GetParameters(); - object[] args = new object[ctorParams.Count()]; - - for (int parameterIndex = 0; parameterIndex < ctorParams.Count(); parameterIndex++) - { - var currentParam = ctorParams[parameterIndex]; - - try - { - args[parameterIndex] = parameters.ContainsKey(currentParam.Name) ? - parameters[currentParam.Name] : - ResolveInternal( - new TypeRegistration(currentParam.ParameterType), - NamedParameterOverloads.Default, - options); - } - catch (TinyIoCResolutionException ex) - { - // If a constructor parameter can't be resolved - // it will throw, so wrap it and throw that this can't - // be resolved. - throw new TinyIoCResolutionException(typeToConstruct, ex); - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(typeToConstruct, ex); - } - } - - try - { -#if USE_OBJECT_CONSTRUCTOR - var constructionDelegate = CreateObjectConstructionDelegateWithCache(constructor); - return constructionDelegate.Invoke(args); -#else - return constructor.Invoke(args); -#endif - } - catch (Exception ex) - { - throw new TinyIoCResolutionException(typeToConstruct, ex); - } - } - -#if USE_OBJECT_CONSTRUCTOR - private static ObjectConstructor CreateObjectConstructionDelegateWithCache(ConstructorInfo constructor) - { - ObjectConstructor objectConstructor; - if (_ObjectConstructorCache.TryGetValue(constructor, out objectConstructor)) - return objectConstructor; - - // We could lock the cache here, but there's no real side - // effect to two threads creating the same ObjectConstructor - // at the same time, compared to the cost of a lock for - // every creation. - var constructorParams = constructor.GetParameters(); - var lambdaParams = Expression.Parameter(typeof(object[]), "parameters"); - var newParams = new Expression[constructorParams.Length]; - - for (int i = 0; i < constructorParams.Length; i++) - { - var paramsParameter = Expression.ArrayIndex(lambdaParams, Expression.Constant(i)); - - newParams[i] = Expression.Convert(paramsParameter, constructorParams[i].ParameterType); - } - - var newExpression = Expression.New(constructor, newParams); - - var constructionLambda = Expression.Lambda(typeof(ObjectConstructor), newExpression, lambdaParams); - - objectConstructor = (ObjectConstructor)constructionLambda.Compile(); - - _ObjectConstructorCache[constructor] = objectConstructor; - return objectConstructor; - } -#endif - - private void BuildUpInternal(object input, ResolveOptions resolveOptions) - { - //#if NETFX_CORE - // var properties = from property in input.GetType().GetTypeInfo().DeclaredProperties - // where (property.GetMethod != null) && (property.SetMethod != null) && !property.PropertyType.GetTypeInfo().IsValueType - // select property; - //#else - var properties = from property in input.GetType().GetProperties() - where (property.GetGetMethod() != null) && (property.GetSetMethod() != null) && !property.PropertyType.IsValueType() - select property; - //#endif - - foreach (var property in properties) - { - if (property.GetValue(input, null) == null) - { - try - { - property.SetValue(input, ResolveInternal(new TypeRegistration(property.PropertyType), NamedParameterOverloads.Default, resolveOptions), null); - } - catch (TinyIoCResolutionException) - { - // Catch any resolution errors and ignore them - } - } - } - } - - private IEnumerable GetParentRegistrationsForType(Type resolveType) - { - if (_Parent == null) - return new TypeRegistration[] { }; - - var registrations = _Parent._RegisteredTypes.Keys.Where(tr => tr.Type == resolveType); - - return registrations.Concat(_Parent.GetParentRegistrationsForType(resolveType)); - } - - private IEnumerable ResolveAllInternal(Type resolveType, bool includeUnnamed) - { - var registrations = _RegisteredTypes.Keys.Where(tr => tr.Type == resolveType).Concat(GetParentRegistrationsForType(resolveType)).Distinct(); - - if (!includeUnnamed) - registrations = registrations.Where(tr => tr.Name != string.Empty); - - return registrations.Select(registration => this.ResolveInternal(registration, NamedParameterOverloads.Default, ResolveOptions.Default)); - } - - private static bool IsValidAssignment(Type registerType, Type registerImplementation) - { - if (!registerType.IsGenericTypeDefinition()) - { - if (!registerType.IsAssignableFrom(registerImplementation)) - return false; - } - else - { - if (registerType.IsInterface()) - { -#if (PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6) - if (!registerImplementation.GetInterfaces().Any(t => t.Name == registerType.Name)) - return false; -#else - if (!registerImplementation.FindInterfaces((t, o) => t.Name == registerType.Name, null).Any()) - return false; -#endif - } - else if (registerType.IsAbstract() && registerImplementation.BaseType() != registerType) - { - return false; - } - } - //#endif - return true; - } - -#endregion - -#region IDisposable Members - bool disposed = false; - public void Dispose() - { - if (!disposed) - { - disposed = true; - - _RegisteredTypes.Dispose(); - - GC.SuppressFinalize(this); - } - } - -#endregion - } - -#if PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6 - static class ReverseTypeExtender - { - public static bool IsClass(this Type type) - { - return type.GetTypeInfo().IsClass; - } - - public static bool IsAbstract(this Type type) - { - return type.GetTypeInfo().IsAbstract; - } - - public static bool IsInterface(this Type type) - { - return type.GetTypeInfo().IsInterface; - } - - public static bool IsPrimitive(this Type type) - { - return type.GetTypeInfo().IsPrimitive; - } - - public static bool IsValueType(this Type type) - { - return type.GetTypeInfo().IsValueType; - } - - public static bool IsGenericType(this Type type) - { - return type.GetTypeInfo().IsGenericType; - } - - public static bool IsGenericParameter(this Type type) - { - return type.IsGenericParameter; - } - - public static bool IsGenericTypeDefinition(this Type type) - { - return type.GetTypeInfo().IsGenericTypeDefinition; - } - - public static Type BaseType(this Type type) - { - return type.GetTypeInfo().BaseType; - } - - public static Assembly Assembly(this Type type) - { - return type.GetTypeInfo().Assembly; - } - } -#endif - // reverse shim for WinRT SR changes... -#if (!NETFX_CORE && !PORTABLE && !NETSTANDARD1_0 && !NETSTANDARD1_1 && !NETSTANDARD1_2 && !NETSTANDARD1_3 && !NETSTANDARD1_4 && !NETSTANDARD1_5 || !NETSTANDARD1_6) - static class ReverseTypeExtender - { - public static bool IsClass(this Type type) - { - return type.IsClass; - } - - public static bool IsAbstract(this Type type) - { - return type.IsAbstract; - } - - public static bool IsInterface(this Type type) - { - return type.IsInterface; - } - - public static bool IsPrimitive(this Type type) - { - return type.IsPrimitive; - } - - public static bool IsValueType(this Type type) - { - return type.IsValueType; - } - - public static bool IsGenericType(this Type type) - { - return type.IsGenericType; - } - - public static bool IsGenericParameter(this Type type) - { - return type.IsGenericParameter; - } - - public static bool IsGenericTypeDefinition(this Type type) - { - return type.IsGenericTypeDefinition; - } - - public static Type BaseType(this Type type) - { - return type.BaseType; - } - - public static Assembly Assembly(this Type type) - { - return type.Assembly; - } - } -#endif -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Triggers/BeginAnimation.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Triggers/BeginAnimation.cs deleted file mode 100644 index d0d1091685..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Triggers/BeginAnimation.cs +++ /dev/null @@ -1,16 +0,0 @@ -using eShopOnContainers.Core.Animations.Base; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Triggers -{ - public class BeginAnimation : TriggerAction - { - public AnimationBase Animation { get; set; } - - protected override async void Invoke(VisualElement sender) - { - if (Animation != null) - await Animation.Begin(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidationRule.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidationRule.cs deleted file mode 100644 index d049e30740..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidationRule.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace eShopOnContainers.Core.Validations -{ - public interface IValidationRule - { - string ValidationMessage { get; set; } - - bool Check(T value); - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidity.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidity.cs deleted file mode 100644 index e468c1fc28..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IValidity.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace eShopOnContainers.Core.Validations -{ - public interface IValidity - { - bool IsValid { get; set; } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IsNotNullOrEmptyRule.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IsNotNullOrEmptyRule.cs deleted file mode 100644 index 3ae1a45656..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/IsNotNullOrEmptyRule.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace eShopOnContainers.Core.Validations -{ - public class IsNotNullOrEmptyRule : IValidationRule - { - public string ValidationMessage { get; set; } - - public bool Check(T value) - { - if (value == null) - { - return false; - } - - var str = value as string; - - return !string.IsNullOrWhiteSpace(str); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/ValidatableObject.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/ValidatableObject.cs deleted file mode 100644 index 11806d17c6..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/ValidatableObject.cs +++ /dev/null @@ -1,75 +0,0 @@ -using eShopOnContainers.Core.ViewModels.Base; -using System.Collections.Generic; -using System.Linq; - -namespace eShopOnContainers.Core.Validations -{ - public class ValidatableObject : ExtendedBindableObject, IValidity - { - private readonly List> _validations; - private List _errors; - private T _value; - private bool _isValid; - - public List> Validations => _validations; - - public List Errors - { - get - { - return _errors; - } - set - { - _errors = value; - RaisePropertyChanged(() => Errors); - } - } - - public T Value - { - get - { - return _value; - } - set - { - _value = value; - RaisePropertyChanged(() => Value); - } - } - - public bool IsValid - { - get - { - return _isValid; - } - set - { - _isValid = value; - RaisePropertyChanged(() => IsValid); - } - } - - public ValidatableObject() - { - _isValid = true; - _errors = new List(); - _validations = new List>(); - } - - public bool Validate() - { - Errors.Clear(); - - IEnumerable errors = _validations.Where(v => !v.Check(Value)) - .Select(v => v.ValidationMessage); - - Errors = errors.ToList(); - IsValid = !Errors.Any(); - - return this.IsValid; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ExtendedBindableObject.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ExtendedBindableObject.cs deleted file mode 100644 index 96ae124c07..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ExtendedBindableObject.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Linq.Expressions; -using System.Reflection; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels.Base -{ - public abstract class ExtendedBindableObject : BindableObject - { - public void RaisePropertyChanged(Expression> property) - { - var name = GetMemberInfo(property).Name; - OnPropertyChanged(name); - } - - private MemberInfo GetMemberInfo(Expression expression) - { - MemberExpression operand; - LambdaExpression lambdaExpression = (LambdaExpression)expression; - if (lambdaExpression.Body as UnaryExpression != null) - { - UnaryExpression body = (UnaryExpression)lambdaExpression.Body; - operand = (MemberExpression)body.Operand; - } - else - { - operand = (MemberExpression)lambdaExpression.Body; - } - return operand.Member; - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessageKeys.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessageKeys.cs deleted file mode 100644 index c968ff21fa..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/MessageKeys.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace eShopOnContainers.Core.ViewModels.Base -{ - public class MessageKeys - { - // Add product to basket - public const string AddProduct = "AddProduct"; - - // Filter - public const string Filter = "Filter"; - - // Change selected Tab programmatically - public const string ChangeTab = "ChangeTab"; - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelBase.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelBase.cs deleted file mode 100644 index 30efc544d1..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Services; -using System.Threading.Tasks; - -namespace eShopOnContainers.Core.ViewModels.Base -{ - public abstract class ViewModelBase : ExtendedBindableObject - { - protected readonly IDialogService DialogService; - protected readonly INavigationService NavigationService; - - private bool _isBusy; - - public bool IsBusy - { - get - { - return _isBusy; - } - - set - { - _isBusy = value; - RaisePropertyChanged(() => IsBusy); - } - } - - public ViewModelBase() - { - DialogService = ViewModelLocator.Resolve(); - NavigationService = ViewModelLocator.Resolve(); - - var settingsService = ViewModelLocator.Resolve(); - - GlobalSetting.Instance.BaseIdentityEndpoint = settingsService.IdentityEndpointBase; - GlobalSetting.Instance.BaseGatewayShoppingEndpoint = settingsService.GatewayShoppingEndpointBase; - GlobalSetting.Instance.BaseGatewayMarketingEndpoint = settingsService.GatewayMarketingEndpointBase; - } - - public virtual Task InitializeAsync(object navigationData) - { - return Task.FromResult(false); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs deleted file mode 100644 index 8a6b6356a5..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/Base/ViewModelLocator.cs +++ /dev/null @@ -1,131 +0,0 @@ -using eShopOnContainers.Core.Services.Basket; -using eShopOnContainers.Core.Services.Catalog; -using eShopOnContainers.Core.Services.Dependency; -using eShopOnContainers.Core.Services.FixUri; -using eShopOnContainers.Core.Services.Identity; -using eShopOnContainers.Core.Services.Location; -using eShopOnContainers.Core.Services.Marketing; -using eShopOnContainers.Core.Services.OpenUrl; -using eShopOnContainers.Core.Services.Order; -using eShopOnContainers.Core.Services.RequestProvider; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.Services.User; -using eShopOnContainers.Services; -using System; -using System.Globalization; -using System.Reflection; -using TinyIoC; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels.Base -{ - public static class ViewModelLocator - { - private static TinyIoCContainer _container; - - public static readonly BindableProperty AutoWireViewModelProperty = - BindableProperty.CreateAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), default(bool), propertyChanged: OnAutoWireViewModelChanged); - - public static bool GetAutoWireViewModel(BindableObject bindable) - { - return (bool)bindable.GetValue(ViewModelLocator.AutoWireViewModelProperty); - } - - public static void SetAutoWireViewModel(BindableObject bindable, bool value) - { - bindable.SetValue(ViewModelLocator.AutoWireViewModelProperty, value); - } - - public static bool UseMockService { get; set; } - - static ViewModelLocator() - { - _container = new TinyIoCContainer(); - - // View models - by default, TinyIoC will register concrete classes as multi-instance. - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - - // Services - by default, TinyIoC will register interface registrations as singletons. - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - } - - public static void UpdateDependencies(bool useMockServices) - { - // Change injected dependencies - if (useMockServices) - { - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - - UseMockService = true; - } - else - { - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - _container.Register(); - - UseMockService = false; - } - } - - public static void RegisterSingleton() where TInterface : class where T : class, TInterface - { - _container.Register().AsSingleton(); - } - - public static T Resolve() where T : class - { - return _container.Resolve(); - } - - private static void OnAutoWireViewModelChanged(BindableObject bindable, object oldValue, object newValue) - { - var view = bindable as Element; - if (view == null) - { - return; - } - - var viewType = view.GetType(); - var viewName = viewType.FullName.Replace(".Views.", ".ViewModels."); - var viewAssemblyName = viewType.GetTypeInfo().Assembly.FullName; - var viewModelName = string.Format(CultureInfo.InvariantCulture, "{0}Model, {1}", viewName, viewAssemblyName); - - var viewModelType = Type.GetType(viewModelName); - if (viewModelType == null) - { - return; - } - var viewModel = _container.Resolve(viewModelType); - view.BindingContext = viewModel; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/BasketViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/BasketViewModel.cs deleted file mode 100644 index 7350ee1b6f..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/BasketViewModel.cs +++ /dev/null @@ -1,162 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Catalog; -using eShopOnContainers.Core.Services.Basket; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.Services.User; -using eShopOnContainers.Core.ViewModels.Base; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class BasketViewModel : ViewModelBase - { - private int _badgeCount; - private ObservableCollection _basketItems; - private decimal _total; - - private ISettingsService _settingsService; - private IBasketService _basketService; - private IUserService _userService; - - public BasketViewModel( - ISettingsService settingsService, - IBasketService basketService, - IUserService userService) - { - _settingsService = settingsService; - _basketService = basketService; - _userService = userService; - } - - public int BadgeCount - { - get { return _badgeCount; } - set - { - _badgeCount = value; - RaisePropertyChanged(() => BadgeCount); - } - } - - public ObservableCollection BasketItems - { - get { return _basketItems; } - set - { - _basketItems = value; - RaisePropertyChanged(() => BasketItems); - } - } - - public decimal Total - { - get { return _total; } - set - { - _total = value; - RaisePropertyChanged(() => Total); - } - } - - public ICommand AddCommand => new Command(async (item) => await AddItemAsync(item)); - - public ICommand CheckoutCommand => new Command(async () => await CheckoutAsync()); - - public override async Task InitializeAsync(object navigationData) - { - if (BasketItems == null) - BasketItems = new ObservableCollection(); - - var authToken = _settingsService.AuthAccessToken; - var userInfo = await _userService.GetUserInfoAsync(authToken); - - // Update Basket - var basket = await _basketService.GetBasketAsync(userInfo.UserId, authToken); - - if (basket != null && basket.Items != null && basket.Items.Any()) - { - BadgeCount = 0; - BasketItems.Clear(); - - foreach (var basketItem in basket.Items) - { - BadgeCount += basketItem.Quantity; - await AddBasketItemAsync(basketItem); - } - } - - MessagingCenter.Unsubscribe(this, MessageKeys.AddProduct); - MessagingCenter.Subscribe(this, MessageKeys.AddProduct, async (sender, arg) => - { - BadgeCount++; - - await AddCatalogItemAsync(arg); - }); - - await base.InitializeAsync(navigationData); - } - - private async Task AddCatalogItemAsync(CatalogItem item) - { - BasketItems.Add(new BasketItem - { - ProductId = item.Id, - ProductName = item.Name, - PictureUrl = item.PictureUri, - UnitPrice = item.Price, - Quantity = 1 - }); - - await ReCalculateTotalAsync(); - } - - private async Task AddItemAsync(BasketItem item) - { - BadgeCount++; - await AddBasketItemAsync(item); - RaisePropertyChanged(() => BasketItems); - } - - private async Task AddBasketItemAsync(BasketItem item) - { - BasketItems.Add(item); - await ReCalculateTotalAsync(); - } - - private async Task ReCalculateTotalAsync() - { - Total = 0; - - if (BasketItems == null) - { - return; - } - - foreach (var orderItem in BasketItems) - { - Total += (orderItem.Quantity * orderItem.UnitPrice); - } - - var authToken = _settingsService.AuthAccessToken; - var userInfo = await _userService.GetUserInfoAsync(authToken); - - await _basketService.UpdateBasketAsync(new CustomerBasket - { - BuyerId = userInfo.UserId, - Items = BasketItems.ToList() - }, authToken); - } - - private async Task CheckoutAsync() - { - if (BasketItems.Any()) - { - await NavigationService.NavigateToAsync(BasketItems); - } - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignDetailsViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignDetailsViewModel.cs deleted file mode 100644 index 2e0275f8bc..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignDetailsViewModel.cs +++ /dev/null @@ -1,63 +0,0 @@ -using eShopOnContainers.Core.Models.Marketing; -using eShopOnContainers.Core.Services.Marketing; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class CampaignDetailsViewModel : ViewModelBase - { - private readonly ISettingsService _settingsService; - private readonly ICampaignService _campaignService; - - private CampaignItem _campaign; - private bool _isDetailsSite; - - public ICommand EnableDetailsSiteCommand => new Command(EnableDetailsSite); - - public CampaignDetailsViewModel(ISettingsService settingsService, ICampaignService campaignService) - { - _settingsService = settingsService; - _campaignService = campaignService; - } - - public CampaignItem Campaign - { - get => _campaign; - set - { - _campaign = value; - RaisePropertyChanged(() => Campaign); - } - } - - public bool IsDetailsSite - { - get => _isDetailsSite; - set - { - _isDetailsSite = value; - RaisePropertyChanged(() => IsDetailsSite); - } - } - - public override async Task InitializeAsync(object navigationData) - { - if (navigationData is int) - { - IsBusy = true; - // Get campaign by id - Campaign = await _campaignService.GetCampaignByIdAsync((int)navigationData, _settingsService.AuthAccessToken); - IsBusy = false; - } - } - - private void EnableDetailsSite() - { - IsDetailsSite = true; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignViewModel.cs deleted file mode 100644 index 53f7cb8477..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CampaignViewModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -using eShopOnContainers.Core.Models.Marketing; -using eShopOnContainers.Core.Services.Marketing; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using System.Collections.ObjectModel; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class CampaignViewModel : ViewModelBase - { - private readonly ISettingsService _settingsService; - private readonly ICampaignService _campaignService; - - private ObservableCollection _campaigns; - - public CampaignViewModel(ISettingsService settingsService, ICampaignService campaignService) - { - _settingsService = settingsService; - _campaignService = campaignService; - } - - public ObservableCollection Campaigns - { - get => _campaigns; - set - { - _campaigns = value; - RaisePropertyChanged(() => Campaigns); - } - } - - public ICommand GetCampaignDetailsCommand => new Command(async (item) => await GetCampaignDetailsAsync(item)); - - public override async Task InitializeAsync(object navigationData) - { - IsBusy = true; - // Get campaigns by user - Campaigns = await _campaignService.GetAllCampaignsAsync(_settingsService.AuthAccessToken); - IsBusy = false; - } - - private async Task GetCampaignDetailsAsync(CampaignItem campaign) - { - await NavigationService.NavigateToAsync(campaign.Id); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs deleted file mode 100644 index 1554f7fb08..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CatalogViewModel.cs +++ /dev/null @@ -1,130 +0,0 @@ -using eShopOnContainers.Core.Models.Catalog; -using eShopOnContainers.Core.Services.Catalog; -using eShopOnContainers.Core.ViewModels.Base; -using System.Collections.ObjectModel; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class CatalogViewModel : ViewModelBase - { - private ObservableCollection _products; - private ObservableCollection _brands; - private CatalogBrand _brand; - private ObservableCollection _types; - private CatalogType _type; - private ICatalogService _productsService; - - public CatalogViewModel(ICatalogService productsService) - { - _productsService = productsService; - } - - public ObservableCollection Products - { - get { return _products; } - set - { - _products = value; - RaisePropertyChanged(() => Products); - } - } - - public ObservableCollection Brands - { - get { return _brands; } - set - { - _brands = value; - RaisePropertyChanged(() => Brands); - } - } - - public CatalogBrand Brand - { - get { return _brand; } - set - { - _brand = value; - RaisePropertyChanged(() => Brand); - RaisePropertyChanged(() => IsFilter); - } - } - - public ObservableCollection Types - { - get { return _types; } - set - { - _types = value; - RaisePropertyChanged(() => Types); - } - } - - public CatalogType Type - { - get { return _type; } - set - { - _type = value; - RaisePropertyChanged(() => Type); - RaisePropertyChanged(() => IsFilter); - } - } - - public bool IsFilter { get { return Brand != null || Type != null; } } - - public ICommand AddCatalogItemCommand => new Command(AddCatalogItem); - - public ICommand FilterCommand => new Command(async () => await FilterAsync()); - - public ICommand ClearFilterCommand => new Command(async () => await ClearFilterAsync()); - - public override async Task InitializeAsync(object navigationData) - { - IsBusy = true; - - // Get Catalog, Brands and Types - Products = await _productsService.GetCatalogAsync(); - Brands = await _productsService.GetCatalogBrandAsync(); - Types = await _productsService.GetCatalogTypeAsync(); - - IsBusy = false; - } - - private void AddCatalogItem(CatalogItem catalogItem) - { - // Add new item to Basket - MessagingCenter.Send(this, MessageKeys.AddProduct, catalogItem); - } - - private async Task FilterAsync() - { - if (Brand == null || Type == null) - { - return; - } - - IsBusy = true; - - // Filter catalog products - MessagingCenter.Send(this, MessageKeys.Filter); - Products = await _productsService.FilterAsync(Brand.Id, Type.Id); - - IsBusy = false; - } - - private async Task ClearFilterAsync() - { - IsBusy = true; - - Brand = null; - Type = null; - Products = await _productsService.GetCatalogAsync(); - - IsBusy = false; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs deleted file mode 100644 index 4eb9010a32..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/CheckoutViewModel.cs +++ /dev/null @@ -1,215 +0,0 @@ -using eShopOnContainers.Core.Models.Basket; -using eShopOnContainers.Core.Models.Navigation; -using eShopOnContainers.Core.Models.Orders; -using eShopOnContainers.Core.Models.User; -using eShopOnContainers.Core.Services.Basket; -using eShopOnContainers.Core.Services.Order; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.Services.User; -using eShopOnContainers.Core.ViewModels.Base; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class CheckoutViewModel : ViewModelBase - { - private ObservableCollection _orderItems; - private Order _order; - private Address _shippingAddress; - - private ISettingsService _settingsService; - private IBasketService _basketService; - private IOrderService _orderService; - private IUserService _userService; - - public CheckoutViewModel( - ISettingsService settingsService, - IBasketService basketService, - IOrderService orderService, - IUserService userService) - { - _settingsService = settingsService; - _basketService = basketService; - _orderService = orderService; - _userService = userService; - } - - public ObservableCollection OrderItems - { - get { return _orderItems; } - set - { - _orderItems = value; - RaisePropertyChanged(() => OrderItems); - } - } - - public Order Order - { - get { return _order; } - set - { - _order = value; - RaisePropertyChanged(() => Order); - } - } - - public Address ShippingAddress - { - get { return _shippingAddress; } - set - { - _shippingAddress = value; - RaisePropertyChanged(() => ShippingAddress); - } - } - - public ICommand CheckoutCommand => new Command(async () => await CheckoutAsync()); - - public override async Task InitializeAsync(object navigationData) - { - if (navigationData is ObservableCollection) - { - IsBusy = true; - - // Get navigation data - var orderItems = ((ObservableCollection)navigationData); - - OrderItems = orderItems; - - var authToken = _settingsService.AuthAccessToken; - var userInfo = await _userService.GetUserInfoAsync(authToken); - - // Create Shipping Address - ShippingAddress = new Address - { - Id = !string.IsNullOrEmpty(userInfo?.UserId) ? new Guid(userInfo.UserId) : Guid.NewGuid(), - Street = userInfo?.Street, - ZipCode = userInfo?.ZipCode, - State = userInfo?.State, - Country = userInfo?.Country, - City = userInfo?.Address - }; - - // Create Payment Info - var paymentInfo = new PaymentInfo - { - CardNumber = userInfo?.CardNumber, - CardHolderName = userInfo?.CardHolder, - CardType = new CardType { Id = 3, Name = "MasterCard" }, - SecurityNumber = userInfo?.CardSecurityNumber - }; - - // Create new Order - Order = new Order - { - BuyerId = userInfo.UserId, - OrderItems = CreateOrderItems(orderItems), - OrderStatus = OrderStatus.Submitted, - OrderDate = DateTime.Now, - CardHolderName = paymentInfo.CardHolderName, - CardNumber = paymentInfo.CardNumber, - CardSecurityNumber = paymentInfo.SecurityNumber, - CardExpiration = DateTime.Now.AddYears(5), - CardTypeId = paymentInfo.CardType.Id, - ShippingState = _shippingAddress.State, - ShippingCountry = _shippingAddress.Country, - ShippingStreet = _shippingAddress.Street, - ShippingCity = _shippingAddress.City, - ShippingZipCode = _shippingAddress.ZipCode, - Total = CalculateTotal(CreateOrderItems(orderItems)) - }; - - if (_settingsService.UseMocks) - { - // Get number of orders - var orders = await _orderService.GetOrdersAsync(authToken); - - // Create the OrderNumber - Order.OrderNumber = orders.Count + 1; - RaisePropertyChanged(() => Order); - } - - IsBusy = false; - } - } - - private async Task CheckoutAsync() - { - try - { - var authToken = _settingsService.AuthAccessToken; - - var basket = _orderService.MapOrderToBasket(Order); - basket.RequestId = Guid.NewGuid(); - - // Create basket checkout - await _basketService.CheckoutAsync(basket, authToken); - - if (_settingsService.UseMocks) - { - await _orderService.CreateOrderAsync(Order, authToken); - } - - // Clean Basket - await _basketService.ClearBasketAsync(_shippingAddress.Id.ToString(), authToken); - - // Reset Basket badge - var basketViewModel = ViewModelLocator.Resolve(); - basketViewModel.BadgeCount = 0; - - // Navigate to Orders - await NavigationService.NavigateToAsync(new TabParameter { TabIndex = 1 }); - await NavigationService.RemoveLastFromBackStackAsync(); - - // Show Dialog - await DialogService.ShowAlertAsync("Order sent successfully!", "Checkout", "Ok"); - await NavigationService.RemoveLastFromBackStackAsync(); - } - catch - { - await DialogService.ShowAlertAsync("An error ocurred. Please, try again.", "Oops!", "Ok"); - } - } - - private List CreateOrderItems(ObservableCollection basketItems) - { - var orderItems = new List(); - - foreach (var basketItem in basketItems) - { - if (!string.IsNullOrEmpty(basketItem.ProductName)) - { - orderItems.Add(new OrderItem - { - OrderId = null, - ProductId = basketItem.ProductId, - ProductName = basketItem.ProductName, - PictureUrl = basketItem.PictureUrl, - Quantity = basketItem.Quantity, - UnitPrice = basketItem.UnitPrice - }); - } - } - - return orderItems; - } - - private decimal CalculateTotal(List orderItems) - { - decimal total = 0; - - foreach (var orderItem in orderItems) - { - total += (orderItem.Quantity * orderItem.UnitPrice); - } - - return total; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs deleted file mode 100644 index cc04deba4d..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs +++ /dev/null @@ -1,290 +0,0 @@ -using eShopOnContainers.Core.Models.User; -using eShopOnContainers.Core.Services.Identity; -using eShopOnContainers.Core.Services.OpenUrl; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.Validations; -using eShopOnContainers.Core.ViewModels.Base; -using IdentityModel.Client; -using System; -using System.Diagnostics; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class LoginViewModel : ViewModelBase - { - private ValidatableObject _userName; - private ValidatableObject _password; - private bool _isMock; - private bool _isValid; - private bool _isLogin; - private string _authUrl; - - private ISettingsService _settingsService; - private IOpenUrlService _openUrlService; - private IIdentityService _identityService; - - public LoginViewModel( - ISettingsService settingsService, - IOpenUrlService openUrlService, - IIdentityService identityService) - { - _settingsService = settingsService; - _openUrlService = openUrlService; - _identityService = identityService; - - _userName = new ValidatableObject(); - _password = new ValidatableObject(); - - InvalidateMock(); - AddValidations(); - } - - public ValidatableObject UserName - { - get - { - return _userName; - } - set - { - _userName = value; - RaisePropertyChanged(() => UserName); - } - } - - public ValidatableObject Password - { - get - { - return _password; - } - set - { - _password = value; - RaisePropertyChanged(() => Password); - } - } - - public bool IsMock - { - get - { - return _isMock; - } - set - { - _isMock = value; - RaisePropertyChanged(() => IsMock); - } - } - - public bool IsValid - { - get - { - return _isValid; - } - set - { - _isValid = value; - RaisePropertyChanged(() => IsValid); - } - } - - public bool IsLogin - { - get - { - return _isLogin; - } - set - { - _isLogin = value; - RaisePropertyChanged(() => IsLogin); - } - } - - public string LoginUrl - { - get - { - return _authUrl; - } - set - { - _authUrl = value; - RaisePropertyChanged(() => LoginUrl); - } - } - - public ICommand MockSignInCommand => new Command(async () => await MockSignInAsync()); - - public ICommand SignInCommand => new Command(async () => await SignInAsync()); - - public ICommand RegisterCommand => new Command(Register); - - public ICommand NavigateCommand => new Command(async (url) => await NavigateAsync(url)); - - public ICommand SettingsCommand => new Command(async () => await SettingsAsync()); - - public ICommand ValidateUserNameCommand => new Command(() => ValidateUserName()); - - public ICommand ValidatePasswordCommand => new Command(() => ValidatePassword()); - - public override Task InitializeAsync(object navigationData) - { - if (navigationData is LogoutParameter) - { - var logoutParameter = (LogoutParameter)navigationData; - - if (logoutParameter.Logout) - { - Logout(); - } - } - - return base.InitializeAsync(navigationData); - } - - private async Task MockSignInAsync() - { - IsBusy = true; - IsValid = true; - bool isValid = Validate(); - bool isAuthenticated = false; - - if (isValid) - { - try - { - await Task.Delay(10); - - isAuthenticated = true; - } - catch (Exception ex) - { - Debug.WriteLine($"[SignIn] Error signing in: {ex}"); - } - } - else - { - IsValid = false; - } - - if (isAuthenticated) - { - _settingsService.AuthAccessToken = GlobalSetting.Instance.AuthToken; - - await NavigationService.NavigateToAsync(); - await NavigationService.RemoveLastFromBackStackAsync(); - } - - IsBusy = false; - } - - private async Task SignInAsync() - { - IsBusy = true; - - await Task.Delay(10); - - LoginUrl = _identityService.CreateAuthorizationRequest(); - - IsValid = true; - IsLogin = true; - IsBusy = false; - } - - private void Register() - { - _openUrlService.OpenUrl(GlobalSetting.Instance.RegisterWebsite); - } - - private void Logout() - { - var authIdToken = _settingsService.AuthIdToken; - var logoutRequest = _identityService.CreateLogoutRequest(authIdToken); - - if (!string.IsNullOrEmpty(logoutRequest)) - { - // Logout - LoginUrl = logoutRequest; - } - - if (_settingsService.UseMocks) - { - _settingsService.AuthAccessToken = string.Empty; - _settingsService.AuthIdToken = string.Empty; - } - - _settingsService.UseFakeLocation = false; - } - - private async Task NavigateAsync(string url) - { - var unescapedUrl = System.Net.WebUtility.UrlDecode(url); - - if (unescapedUrl.Equals(GlobalSetting.Instance.LogoutCallback)) - { - _settingsService.AuthAccessToken = string.Empty; - _settingsService.AuthIdToken = string.Empty; - IsLogin = false; - LoginUrl = _identityService.CreateAuthorizationRequest(); - } - else if (unescapedUrl.Contains(GlobalSetting.Instance.Callback)) - { - var authResponse = new AuthorizeResponse(url); - if (!string.IsNullOrWhiteSpace(authResponse.Code)) - { - var userToken = await _identityService.GetTokenAsync(authResponse.Code); - string accessToken = userToken.AccessToken; - - if (!string.IsNullOrWhiteSpace(accessToken)) - { - _settingsService.AuthAccessToken = accessToken; - _settingsService.AuthIdToken = authResponse.IdentityToken; - await NavigationService.NavigateToAsync(); - await NavigationService.RemoveLastFromBackStackAsync(); - } - } - } - } - - private async Task SettingsAsync() - { - await NavigationService.NavigateToAsync(); - } - - private bool Validate() - { - bool isValidUser = ValidateUserName(); - bool isValidPassword = ValidatePassword(); - - return isValidUser && isValidPassword; - } - - private bool ValidateUserName() - { - return _userName.Validate(); - } - - private bool ValidatePassword() - { - return _password.Validate(); - } - - private void AddValidations() - { - _userName.Validations.Add(new IsNotNullOrEmptyRule { ValidationMessage = "A username is required." }); - _password.Validations.Add(new IsNotNullOrEmptyRule { ValidationMessage = "A password is required." }); - } - - public void InvalidateMock() - { - IsMock = _settingsService.UseMocks; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs deleted file mode 100644 index 77ecf16c99..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,32 +0,0 @@ -using eShopOnContainers.Core.Models.Navigation; -using eShopOnContainers.Core.ViewModels.Base; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class MainViewModel : ViewModelBase - { - public ICommand SettingsCommand => new Command(async () => await SettingsAsync()); - - public override Task InitializeAsync(object navigationData) - { - IsBusy = true; - - if (navigationData is TabParameter) - { - // Change selected application tab - var tabIndex = ((TabParameter)navigationData).TabIndex; - MessagingCenter.Send(this, MessageKeys.ChangeTab, tabIndex); - } - - return base.InitializeAsync(navigationData); - } - - private async Task SettingsAsync() - { - await NavigationService.NavigateToAsync(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs deleted file mode 100644 index 07ad7fffd9..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/OrderDetailViewModel.cs +++ /dev/null @@ -1,96 +0,0 @@ -using eShopOnContainers.Core.Models.Orders; -using eShopOnContainers.Core.Services.Order; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class OrderDetailViewModel : ViewModelBase - { - private readonly ISettingsService _settingsService; - private readonly IOrderService _ordersService; - - private Order _order; - private bool _isSubmittedOrder; - private string _orderStatusText; - - public OrderDetailViewModel(ISettingsService settingsService, IOrderService ordersService) - { - _settingsService = settingsService; - _ordersService = ordersService; - } - - public Order Order - { - get => _order; - set - { - _order = value; - RaisePropertyChanged(() => Order); - } - } - - public bool IsSubmittedOrder - { - get => _isSubmittedOrder; - set - { - _isSubmittedOrder = value; - RaisePropertyChanged(() => IsSubmittedOrder); - } - } - - public string OrderStatusText - { - get => _orderStatusText; - set - { - _orderStatusText = value; - RaisePropertyChanged(() => OrderStatusText); - } - } - - - public ICommand ToggleCancelOrderCommand => new Command(async () => await ToggleCancelOrderAsync()); - - public override async Task InitializeAsync(object navigationData) - { - if (navigationData is Order) - { - IsBusy = true; - - var order = navigationData as Order; - - // Get order detail info - var authToken = _settingsService.AuthAccessToken; - Order = await _ordersService.GetOrderAsync(order.OrderNumber, authToken); - IsSubmittedOrder = Order.OrderStatus == OrderStatus.Submitted; - OrderStatusText = Order.OrderStatus.ToString().ToUpper(); - - IsBusy = false; - } - } - - private async Task ToggleCancelOrderAsync() - { - var authToken = _settingsService.AuthAccessToken; - - var result = await _ordersService.CancelOrderAsync(_order.OrderNumber, authToken); - - if (result) - { - OrderStatusText = OrderStatus.Cancelled.ToString().ToUpper(); - } - else - { - Order = await _ordersService.GetOrderAsync(Order.OrderNumber, authToken); - OrderStatusText = Order.OrderStatus.ToString().ToUpper(); - } - - IsSubmittedOrder = false; - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/ProfileViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/ProfileViewModel.cs deleted file mode 100644 index b54814a15c..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/ProfileViewModel.cs +++ /dev/null @@ -1,68 +0,0 @@ -using eShopOnContainers.Core.Extensions; -using eShopOnContainers.Core.Models.Orders; -using eShopOnContainers.Core.Models.User; -using eShopOnContainers.Core.Services.Order; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using System.Collections.ObjectModel; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.ViewModels -{ - public class ProfileViewModel : ViewModelBase - { - private readonly ISettingsService _settingsService; - private readonly IOrderService _orderService; - private ObservableCollection _orders; - - public ProfileViewModel(ISettingsService settingsService, IOrderService orderService) - { - _settingsService = settingsService; - _orderService = orderService; - } - - public ObservableCollection Orders - { - get { return _orders; } - set - { - _orders = value; - RaisePropertyChanged(() => Orders); - } - } - - public ICommand LogoutCommand => new Command(async () => await LogoutAsync()); - - public ICommand OrderDetailCommand => new Command(async (order) => await OrderDetailAsync(order)); - - public override async Task InitializeAsync(object navigationData) - { - IsBusy = true; - - // Get orders - var authToken = _settingsService.AuthAccessToken; - var orders = await _orderService.GetOrdersAsync(authToken); - Orders = orders.ToObservableCollection(); - - IsBusy = false; - } - - private async Task LogoutAsync() - { - IsBusy = true; - - // Logout - await NavigationService.NavigateToAsync(new LogoutParameter { Logout = true }); - await NavigationService.RemoveBackStackAsync(); - - IsBusy = false; - } - - private async Task OrderDetailAsync(Order order) - { - await NavigationService.NavigateToAsync(order); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/SettingsViewModel.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/SettingsViewModel.cs deleted file mode 100644 index 9f8b42b2c3..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/SettingsViewModel.cs +++ /dev/null @@ -1,323 +0,0 @@ -using eShopOnContainers.Core.Models.Location; -using eShopOnContainers.Core.Models.User; -using eShopOnContainers.Core.Services.Location; -using eShopOnContainers.Core.Services.Settings; -using eShopOnContainers.Core.ViewModels.Base; -using System.Globalization; -using System.Threading.Tasks; -using System.Windows.Input; -using Xamarin.Forms; -using eShopOnContainers.Core.Services.Dependency; - -namespace eShopOnContainers.Core.ViewModels -{ - public class SettingsViewModel : ViewModelBase - { - private bool _useAzureServices; - private bool _allowGpsLocation; - private bool _useFakeLocation; - private string _identityEndpoint; - private string _gatewayShoppingEndpoint; - private string _gatewayMarketingEndpoint; - private double _latitude; - private double _longitude; - private string _gpsWarningMessage; - - private readonly ISettingsService _settingsService; - private readonly ILocationService _locationService; - private readonly IDependencyService _dependencyService; - - public SettingsViewModel(ISettingsService settingsService, ILocationService locationService, IDependencyService dependencyService) - { - _settingsService = settingsService; - _locationService = locationService; - _dependencyService = dependencyService; - - _useAzureServices = !_settingsService.UseMocks; - _identityEndpoint = _settingsService.IdentityEndpointBase; - _gatewayShoppingEndpoint = _settingsService.GatewayShoppingEndpointBase; - _gatewayMarketingEndpoint = _settingsService.GatewayMarketingEndpointBase; - _latitude = double.Parse(_settingsService.Latitude, CultureInfo.CurrentCulture); - _longitude = double.Parse(_settingsService.Longitude, CultureInfo.CurrentCulture); - _useFakeLocation = _settingsService.UseFakeLocation; - _allowGpsLocation = _settingsService.AllowGpsLocation; - _gpsWarningMessage = string.Empty; - } - - public string TitleUseAzureServices - { - get { return !UseAzureServices ? "Use Mock Services" : "Use Microservices/Containers from eShopOnContainers"; } - } - - public string DescriptionUseAzureServices - { - get - { - return !UseAzureServices - ? "Mock Services are simulated objects that mimic the behavior of real services using a controlled approach." - : "When enabling the use of microservices/containers, the app will attempt to use real services deployed as Docker/Kubernetes containers at the specified base endpoint, which will must be reachable through the network."; - } - } - - public bool UseAzureServices - { - get => _useAzureServices; - set - { - _useAzureServices = value; - UpdateUseAzureServices(); - RaisePropertyChanged(() => UseAzureServices); - } - } - - public string TitleUseFakeLocation - { - get { return !UseFakeLocation ? "Use Real Location" : "Use Fake Location"; } - } - - public string DescriptionUseFakeLocation - { - get - { - return !UseFakeLocation - ? "When enabling location, the app will attempt to use the location from the device." - : "Fake Location data is added for marketing campaign testing."; - } - } - - public bool UseFakeLocation - { - get => _useFakeLocation; - set - { - _useFakeLocation = value; - UpdateFakeLocation(); - RaisePropertyChanged(() => UseFakeLocation); - } - } - - public string TitleAllowGpsLocation - { - get { return !AllowGpsLocation ? "GPS Location Disabled" : "GPS Location Enabled"; } - } - - public string DescriptionAllowGpsLocation - { - get - { - return !AllowGpsLocation - ? "When disabling location, you won't receive location campaigns based upon your location." - : "When enabling location, you'll receive location campaigns based upon your location."; - } - } - - public string GpsWarningMessage - { - get => _gpsWarningMessage; - set - { - _gpsWarningMessage = value; - RaisePropertyChanged(() => GpsWarningMessage); - } - } - - public string IdentityEndpoint - { - get => _identityEndpoint; - set - { - _identityEndpoint = value; - if (!string.IsNullOrEmpty(_identityEndpoint)) - { - UpdateIdentityEndpoint(); - } - RaisePropertyChanged(() => IdentityEndpoint); - } - } - - public string GatewayShoppingEndpoint - { - get => _gatewayShoppingEndpoint; - set - { - _gatewayShoppingEndpoint = value; - if (!string.IsNullOrEmpty(_gatewayShoppingEndpoint)) - { - UpdateGatewayShoppingEndpoint(); - } - RaisePropertyChanged(() => GatewayShoppingEndpoint); - } - } - - public string GatewayMarketingEndpoint - { - get => _gatewayMarketingEndpoint; - set - { - _gatewayMarketingEndpoint = value; - if (!string.IsNullOrEmpty(_gatewayMarketingEndpoint)) - { - UpdateGatewayMarketingEndpoint(); - } - RaisePropertyChanged(() => GatewayMarketingEndpoint); - } - } - - public double Latitude - { - get => _latitude; - set - { - _latitude = value; - UpdateLatitude(); - RaisePropertyChanged(() => Latitude); - } - } - - public double Longitude - { - get => _longitude; - set - { - _longitude = value; - UpdateLongitude(); - RaisePropertyChanged(() => Longitude); - } - } - - public bool AllowGpsLocation - { - get => _allowGpsLocation; - set - { - _allowGpsLocation = value; - UpdateAllowGpsLocation(); - RaisePropertyChanged(() => AllowGpsLocation); - } - } - - public bool UserIsLogged => !string.IsNullOrEmpty(_settingsService.AuthAccessToken); - - public ICommand ToggleMockServicesCommand => new Command(async () => await ToggleMockServicesAsync()); - - public ICommand ToggleFakeLocationCommand => new Command(ToggleFakeLocationAsync); - - public ICommand ToggleSendLocationCommand => new Command(async () => await ToggleSendLocationAsync()); - - public ICommand ToggleAllowGpsLocationCommand => new Command(ToggleAllowGpsLocation); - - private async Task ToggleMockServicesAsync() - { - ViewModelLocator.UpdateDependencies(!UseAzureServices); - RaisePropertyChanged(() => TitleUseAzureServices); - RaisePropertyChanged(() => DescriptionUseAzureServices); - - var previousPageViewModel = NavigationService.PreviousPageViewModel; - if (previousPageViewModel != null) - { - if (previousPageViewModel is MainViewModel) - { - // Slight delay so that page navigation isn't instantaneous - await Task.Delay(1000); - if (UseAzureServices) - { - _settingsService.AuthAccessToken = string.Empty; - _settingsService.AuthIdToken = string.Empty; - - await NavigationService.NavigateToAsync(new LogoutParameter { Logout = true }); - await NavigationService.RemoveBackStackAsync(); - } - } - } - } - - private void ToggleFakeLocationAsync() - { - ViewModelLocator.UpdateDependencies(!UseAzureServices); - RaisePropertyChanged(() => TitleUseFakeLocation); - RaisePropertyChanged(() => DescriptionUseFakeLocation); - } - - private async Task ToggleSendLocationAsync() - { - if (!_settingsService.UseMocks) - { - var locationRequest = new Location - { - Latitude = _latitude, - Longitude = _longitude - }; - var authToken = _settingsService.AuthAccessToken; - - await _locationService.UpdateUserLocation(locationRequest, authToken); - } - } - - private void ToggleAllowGpsLocation() - { - RaisePropertyChanged(() => TitleAllowGpsLocation); - RaisePropertyChanged(() => DescriptionAllowGpsLocation); - } - - private void UpdateUseAzureServices() - { - // Save use mocks services to local storage - _settingsService.UseMocks = !_useAzureServices; - } - - private void UpdateIdentityEndpoint() - { - // Update remote endpoint (save to local storage) - GlobalSetting.Instance.BaseIdentityEndpoint = _settingsService.IdentityEndpointBase = _identityEndpoint; - } - - private void UpdateGatewayShoppingEndpoint() - { - GlobalSetting.Instance.BaseGatewayShoppingEndpoint = _settingsService.GatewayShoppingEndpointBase = _gatewayShoppingEndpoint; - } - - private void UpdateGatewayMarketingEndpoint() - { - GlobalSetting.Instance.BaseGatewayMarketingEndpoint = _settingsService.GatewayMarketingEndpointBase = _gatewayMarketingEndpoint; - } - - private void UpdateFakeLocation() - { - _settingsService.UseFakeLocation = _useFakeLocation; - } - - private void UpdateLatitude() - { - // Update fake latitude (save to local storage) - _settingsService.Latitude = _latitude.ToString(); - } - - private void UpdateLongitude() - { - // Update fake longitude (save to local storage) - _settingsService.Longitude = _longitude.ToString(); - } - - private void UpdateAllowGpsLocation() - { - if (_allowGpsLocation) - { - var locator = _dependencyService.Get(); - if (!locator.IsGeolocationEnabled) - { - _allowGpsLocation = false; - GpsWarningMessage = "Enable the GPS sensor on your device"; - } - else - { - _settingsService.AllowGpsLocation = _allowGpsLocation; - GpsWarningMessage = string.Empty; - } - } - else - { - _settingsService.AllowGpsLocation = _allowGpsLocation; - } - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml deleted file mode 100644 index 012357ec18..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml.cs deleted file mode 100644 index 8e39a3f0d3..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/BasketView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class BasketView : ContentPage - { - public BasketView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml deleted file mode 100644 index 5c99062c73..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml.cs deleted file mode 100644 index f76a904c05..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignDetailsView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class CampaignDetailsView : ContentPage - { - public CampaignDetailsView() - { - InitializeComponent(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml deleted file mode 100644 index 0ec8f0a6bb..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml.cs deleted file mode 100644 index e48bf87fb5..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CampaignView.xaml.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class CampaignView : ContentPage - { - - public CampaignView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml deleted file mode 100644 index 6f834d7c02..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml.cs deleted file mode 100644 index 32c6b82c19..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CatalogView.xaml.cs +++ /dev/null @@ -1,67 +0,0 @@ -using eShopOnContainers.Core.ViewModels; -using eShopOnContainers.Core.ViewModels.Base; -using SlideOverKit; -using System; -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class CatalogView : ContentPage, IMenuContainerPage - { - private FiltersView _filterView = new FiltersView(); - - public CatalogView() - { - InitializeComponent(); - - SlideMenu = _filterView; - - MessagingCenter.Subscribe(this, MessageKeys.Filter, (sender) => - { - Filter(); - }); - } - - public Action HideMenuAction - { - get; - set; - } - - public Action ShowMenuAction - { - get; - set; - } - - public SlideMenuView SlideMenu - { - get; - set; - } - - protected override void OnBindingContextChanged() - { - base.OnBindingContextChanged(); - - _filterView.BindingContext = BindingContext; - } - - private void OnFilterChanged(object sender, EventArgs e) - { - Filter(); - } - - private void Filter() - { - if (SlideMenu.IsShown) - { - HideMenuAction?.Invoke(); - } - else - { - ShowMenuAction?.Invoke(); - } - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml deleted file mode 100644 index 7b3b470778..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs deleted file mode 100644 index f6a5f00b5c..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CheckoutView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class CheckoutView : ContentPage - { - public CheckoutView() - { - InitializeComponent(); - } - } -} diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml deleted file mode 100644 index ec1d9ce839..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml.cs deleted file mode 100644 index 54fe9af541..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/CustomNavigationView.xaml.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class CustomNavigationView : NavigationPage - { - public CustomNavigationView() : base() - { - InitializeComponent(); - } - - public CustomNavigationView(Page root) : base(root) - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml deleted file mode 100644 index b7ebe0c0a3..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/FiltersView.xaml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs deleted file mode 100644 index 10f6269c3b..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/OrderDetailView.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Xamarin.Forms; - -namespace eShopOnContainers.Core.Views -{ - public partial class OrderDetailView : ContentPage - { - public OrderDetailView() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml deleted file mode 100644 index 91165559c9..0000000000 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/ProfileView.xaml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - -