diff --git a/obsolete/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 b/deploy/windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 similarity index 100% rename from obsolete/cli-windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 rename to deploy/windows/add-firewall-rules-for-sts-auth-thru-docker.ps1 diff --git a/obsolete/cli-windows/set-dockernat-networkategory-to-private.ps1 b/deploy/windows/set-dockernat-networkategory-to-private.ps1 similarity index 100% rename from obsolete/cli-windows/set-dockernat-networkategory-to-private.ps1 rename to deploy/windows/set-dockernat-networkategory-to-private.ps1 diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile index 1f5c77573..3e2aef9f0 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.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" 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 a0ba7bd58..770d084c3 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.0 + netcoreapp3.1 Mobile.Shopping.HttpAggregator Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator ..\..\..\docker-compose.dcproj @@ -15,19 +15,19 @@ - - - - - - - + + + + + + + - - - - - + + + + + diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs index 5c8128be8..609b6cdd9 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs @@ -49,7 +49,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services var request = MapToCustomerBasketRequest(currentBasket); _logger.LogDebug("Grpc update basket request {@request}", request); - return client.UpdateBasketAsync(request); + return await client.UpdateBasketAsync(request); }); } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile b/src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile index b449be5b1..707126347 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.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" 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 92e524eb0..2cef24f4e 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.0 + netcoreapp3.1 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 1db0dce7d..ca139c382 100644 --- a/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj +++ b/src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj @@ -5,7 +5,7 @@ - - + + diff --git a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj index e07454650..69d2c0c05 100644 --- a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 6e13b2196..00b95b211 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -7,11 +7,11 @@ - - - - - + + + + + diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 8f24578d5..8435246a3 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj index e009e08c3..bfc322c34 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj @@ -6,14 +6,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj index 51567f38a..a6ccbe05e 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj @@ -1,22 +1,22 @@  - netcoreapp3.0 + netcoreapp3.1 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 579be01df..b0e9ca4ca 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; ..\..\..\..\docker-compose.dcproj false @@ -16,29 +16,30 @@ - - - - - - - - - - + + + + + + + + + + - + - - - + + + + - - + + - - + + diff --git a/src/Services/Basket/Basket.API/Dockerfile b/src/Services/Basket/Basket.API/Dockerfile index 9a068d83e..872955122 100644 --- a/src/Services/Basket/Basket.API/Dockerfile +++ b/src/Services/Basket/Basket.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj index e229bf4dc..fa01363de 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj +++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 false @@ -16,10 +16,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj index cb4559f97..920b4f1da 100644 --- a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj +++ b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj @@ -1,20 +1,18 @@  - netcoreapp3.0 + netcoreapp3.1 false false - - - - - - - + + + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 2a08b699c..a2c32d99b 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 portable true Catalog.API @@ -42,28 +42,29 @@ - - - - - - - - - - - + + + + + + + + + + + - - - + + + + - - + + - - + + diff --git a/src/Services/Catalog/Catalog.API/Dockerfile b/src/Services/Catalog/Catalog.API/Dockerfile index 4c227b11a..0f11f1935 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile +++ b/src/Services/Catalog/Catalog.API/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj index 1a2079c49..a1e04922e 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj +++ b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 false @@ -33,9 +33,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs b/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs index 7410551e4..f7529f73c 100644 --- a/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs +++ b/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs @@ -1,90 +1,132 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.eShopOnContainers.WebMVC.Controllers; -using Microsoft.eShopOnContainers.WebMVC.Services; -using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels; +using Catalog.API.IntegrationEvents; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.eShopOnContainers.Services.Catalog.API; +using Microsoft.eShopOnContainers.Services.Catalog.API.Controllers; +using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; +using Microsoft.eShopOnContainers.Services.Catalog.API.Model; +using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel; +using Microsoft.Extensions.Options; using Moq; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using Xunit; -using CatalogModel = Microsoft.eShopOnContainers.WebMVC.ViewModels.Catalog; namespace UnitTest.Catalog.Application { public class CatalogControllerTest { - private readonly Mock _catalogServiceMock; + private readonly DbContextOptions _dbOptions; public CatalogControllerTest() { - _catalogServiceMock = new Mock(); + _dbOptions = new DbContextOptionsBuilder() + .UseInMemoryDatabase(databaseName: "in-memory") + .Options; + + using (var dbContext = new CatalogContext(_dbOptions)) + { + dbContext.AddRange(GetFakeCatalog()); + dbContext.SaveChanges(); + } } [Fact] public async Task Get_catalog_items_success() { //Arrange - var fakeBrandFilterApplied = 1; - var fakeTypesFilterApplied = 2; - var fakePage = 2; - var fakeCatalog = GetFakeCatalog(); + var brandFilterApplied = 1; + var typesFilterApplied = 2; + var pageSize = 4; + var pageIndex = 1; - var expectedNumberOfPages = 5; - var expectedTotalPages = 50; - var expectedCurrentPage = 2; + var expectedItemsInPage = 2; + var expectedTotalItems = 6; - _catalogServiceMock.Setup(x => x.GetCatalogItems - ( - It.Is(y => y == fakePage), - It.IsAny(), - It.Is(y => y == fakeBrandFilterApplied), - It.Is(y => y == fakeTypesFilterApplied) - )) - .Returns(Task.FromResult(fakeCatalog)); + var catalogContext = new CatalogContext(_dbOptions); + var catalogSettings = new TestCatalogSettings(); + + var integrationServicesMock = new Mock(); //Act - var orderController = new CatalogController(_catalogServiceMock.Object); - var actionResult = await orderController.Index(fakeBrandFilterApplied, fakeTypesFilterApplied, fakePage, null); + var orderController = new CatalogController(catalogContext, catalogSettings, integrationServicesMock.Object); + var actionResult = await orderController.ItemsByTypeIdAndBrandIdAsync(typesFilterApplied, brandFilterApplied, pageSize, pageIndex); //Assert - var viewResult = Assert.IsType(actionResult); - var model = Assert.IsAssignableFrom(viewResult.ViewData.Model); - Assert.Equal(model.PaginationInfo.TotalPages, expectedNumberOfPages); - Assert.Equal(model.PaginationInfo.TotalItems, expectedTotalPages); - Assert.Equal(model.PaginationInfo.ActualPage, expectedCurrentPage); - Assert.Empty(model.PaginationInfo.Next); - Assert.Empty(model.PaginationInfo.Previous); - } - - private CatalogModel GetFakeCatalog() + Assert.IsType>>(actionResult); + var page = Assert.IsAssignableFrom>(actionResult.Value); + Assert.Equal(expectedTotalItems, page.Count); + Assert.Equal(pageIndex, page.PageIndex); + Assert.Equal(pageSize, page.PageSize); + Assert.Equal(expectedItemsInPage, page.Data.Count()); + } + + private List GetFakeCatalog() { - return new CatalogModel() + return new List() { - PageSize = 10, - Count = 50, - PageIndex = 2, - Data = new List() + new CatalogItem() + { + Id = 1, + Name = "fakeItemA", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemA.png" + }, + new CatalogItem() + { + Id = 2, + Name = "fakeItemB", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemB.png" + }, + new CatalogItem() + { + Id = 3, + Name = "fakeItemC", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemC.png" + }, + new CatalogItem() { - new CatalogItem() - { - Id = 1, - Name = "fakeItemA", - CatalogTypeId = 1 - }, - new CatalogItem() - { - Id = 2, - Name = "fakeItemB", - CatalogTypeId = 1 - }, - new CatalogItem() - { - Id = 3, - Name = "fakeItemC", - CatalogTypeId = 1 - } + Id = 4, + Name = "fakeItemD", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemD.png" + }, + new CatalogItem() + { + Id = 5, + Name = "fakeItemE", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemE.png" + }, + new CatalogItem() + { + Id = 6, + Name = "fakeItemF", + CatalogTypeId = 2, + CatalogBrandId = 1, + PictureFileName = "fakeItemF.png" } }; } } + + public class TestCatalogSettings : IOptionsSnapshot + { + public CatalogSettings Value => new CatalogSettings + { + PicBaseUrl = "http://image-server.com/", + AzureStorageEnabled = true + }; + + public CatalogSettings Get(string name) => Value; + } + } diff --git a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj index 0a097242e..7c64276b4 100644 --- a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj +++ b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj @@ -1,17 +1,16 @@  - netcoreapp3.0 + netcoreapp3.1 false false - - - - - + + + + all runtime; build; native; contentfiles; analyzers @@ -20,7 +19,6 @@ - diff --git a/src/Services/Identity/Identity.API/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile index a292540ed..035dd6fc0 100644 --- a/src/Services/Identity/Identity.API/Dockerfile +++ b/src/Services/Identity/Identity.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index b70653cfb..426b5d461 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5 ..\..\..\..\docker-compose.dcproj false @@ -16,39 +16,39 @@ - - - - - - - - - - + + + + + + + + + + - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + - - + + - - + + diff --git a/src/Services/Location/Locations.API/Dockerfile b/src/Services/Location/Locations.API/Dockerfile index f10437db6..b8857b997 100644 --- a/src/Services/Location/Locations.API/Dockerfile +++ b/src/Services/Location/Locations.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Location/Locations.API/Locations.API.csproj b/src/Services/Location/Locations.API/Locations.API.csproj index 10eb6b5b7..d4899becb 100644 --- a/src/Services/Location/Locations.API/Locations.API.csproj +++ b/src/Services/Location/Locations.API/Locations.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 ..\..\..\..\docker-compose.dcproj aspnet-Locations.API-20161122013619 false @@ -10,29 +10,30 @@ - - - - - - - + + + + + + + - + - - - - - - + + + + + + + - - + + - - + + diff --git a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj index 742e2d409..0b6f4f1fa 100644 --- a/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj +++ b/src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 false false @@ -17,9 +17,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Marketing/Marketing.API/Dockerfile b/src/Services/Marketing/Marketing.API/Dockerfile index cd249e94e..1fec56f50 100644 --- a/src/Services/Marketing/Marketing.API/Dockerfile +++ b/src/Services/Marketing/Marketing.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Marketing/Marketing.API/Marketing.API.csproj b/src/Services/Marketing/Marketing.API/Marketing.API.csproj index 56d685e61..bc3116fc3 100644 --- a/src/Services/Marketing/Marketing.API/Marketing.API.csproj +++ b/src/Services/Marketing/Marketing.API/Marketing.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 ..\..\..\..\docker-compose.dcproj Microsoft.eShopOnContainers.Services.Marketing.API $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; @@ -24,31 +24,32 @@ - - - - - - - - - + + + + + + + + + - + - - - - - - + + + + + + + - - + + - - + + diff --git a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj index 6d7d6ff14..f166db7b5 100644 --- a/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj +++ b/src/Services/Marketing/Marketing.FunctionalTests/Marketing.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 false @@ -17,9 +17,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Ordering/Ordering.API/Dockerfile b/src/Services/Ordering/Ordering.API/Dockerfile index 62894ce9f..226652f08 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile +++ b/src/Services/Ordering/Ordering.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index 49688e07d..c212bfe05 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 aspnet-Ordering.API-20161122013547 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; ..\..\..\..\docker-compose.dcproj @@ -37,36 +37,36 @@ - - - - - - - - - - + + + + + + + + + + - - + + - + - - - - - - + + + + + + - - + + - - + + diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile index c21192a89..4b9b51970 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Extensions/CustomExtensionMethods.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Extensions/CustomExtensionMethods.cs index 751ae71ee..82ffae84f 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Extensions/CustomExtensionMethods.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Extensions/CustomExtensionMethods.cs @@ -128,13 +128,18 @@ namespace Ordering.BackgroundTasks.Extensions public static ILoggingBuilder UseSerilog(this ILoggingBuilder builder, IConfiguration configuration) { + var seqServerUrl = configuration["Serilog:SeqServerUrl"]; + var logstashUrl = configuration["Serilog:LogstashgUrl"]; + Log.Logger = new LoggerConfiguration() - .MinimumLevel.Verbose() - .Enrich.WithProperty("ApplicationContext", "BackgroundTasks") - .Enrich.FromLogContext() - .WriteTo.Console() - .ReadFrom.Configuration(configuration) - .CreateLogger(); + .MinimumLevel.Verbose() + .Enrich.WithProperty("ApplicationContext", Program.AppName) + .Enrich.FromLogContext() + .WriteTo.Console() + .WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl) + .WriteTo.Http(string.IsNullOrWhiteSpace(logstashUrl) ? "http://logstash:8080" : logstashUrl) + .ReadFrom.Configuration(configuration) + .CreateLogger(); return builder; } diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj index 7eed9b117..012a0fa18 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E false Linux @@ -9,24 +9,22 @@ - - - - - + + + + + - - + - - + - + - - + + - + diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs index a483bb1f8..ab30ba2d9 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs @@ -1,28 +1,26 @@ using Autofac.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Ordering.BackgroundTasks.Extensions; -using Ordering.BackgroundTasks.Tasks; using Serilog; using System.IO; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; namespace Ordering.BackgroundTasks { public class Program { - public static readonly string Namespace = typeof(Program).Namespace; - public static readonly string AppName = Namespace; + public static readonly string AppName = typeof(Program).Assembly.GetName().Name; public static void Main(string[] args) { CreateHostBuilder(args).Run(); } - public static IWebHost CreateHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) + public static IHost CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .UseServiceProviderFactory(new AutofacServiceProviderFactory()) + .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) .ConfigureAppConfiguration((host, builder) => { builder.SetBasePath(Directory.GetCurrentDirectory()); @@ -32,7 +30,6 @@ namespace Ordering.BackgroundTasks builder.AddCommandLine(args); }) .ConfigureLogging((host, builder) => builder.UseSerilog(host.Configuration).AddSerilog()) - .UseStartup() .Build(); } } diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs index 1f35b711c..8b1c80171 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs @@ -21,19 +21,13 @@ public IConfiguration Configuration { get; } - public virtual IServiceProvider ConfigureServices(IServiceCollection services) + public virtual void ConfigureServices(IServiceCollection services) { services.AddCustomHealthCheck(this.Configuration) .Configure(this.Configuration) .AddOptions() .AddHostedService() - .AddEventBus(this.Configuration) - .AddAutofac(container => container.Populate(services)); - - var container = new ContainerBuilder(); - container.Populate(services); - - return new AutofacServiceProvider(container.Build()); + .AddEventBus(this.Configuration); } diff --git a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj index 05ae14ea0..3f95f3c0b 100644 --- a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj +++ b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj index 119f72863..523c725fc 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj +++ b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 false @@ -17,9 +17,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj index a83c6d2ff..6675a2301 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj +++ b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile index b684c3027..47a9c2d7e 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Dockerfile +++ b/src/Services/Ordering/Ordering.SignalrHub/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index 315cf6edf..ebe4cb70e 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 ..\..\..\..\docker-compose.dcproj false true @@ -13,26 +13,26 @@ - - - - - - + + + + + + - + - + - - + + - - + + - + diff --git a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj index 69bc989a0..1ef8fc554 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj +++ b/src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj @@ -1,18 +1,16 @@  - netcoreapp3.0 + netcoreapp3.1 false false - - - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Services/Payment/Payment.API/Dockerfile b/src/Services/Payment/Payment.API/Dockerfile index 08115ed21..a54069686 100644 --- a/src/Services/Payment/Payment.API/Dockerfile +++ b/src/Services/Payment/Payment.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 48aa65102..10f0e261a 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 ..\..\..\..\docker-compose.dcproj $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; false @@ -10,22 +10,22 @@ - - - - - - + + + + + + - - - + + + - - + + - + diff --git a/src/Services/Webhooks/Webhooks.API/Dockerfile b/src/Services/Webhooks/Webhooks.API/Dockerfile index 5e6c37b7d..f8de8604f 100644 --- a/src/Services/Webhooks/Webhooks.API/Dockerfile +++ b/src/Services/Webhooks/Webhooks.API/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index dfbc5cb7b..6624001c4 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 InProcess Linux $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; @@ -11,18 +11,18 @@ - - - - - + + + + + - + - + - + diff --git a/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj b/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj index 0ce51e413..0239c1ade 100644 --- a/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj +++ b/src/Tests/Services/Application.FunctionalTests/Application.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 true false false @@ -67,10 +67,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Web/WebMVC/Dockerfile b/src/Web/WebMVC/Dockerfile index 60a2ff5ad..7256edb23 100644 --- a/src/Web/WebMVC/Dockerfile +++ b/src/Web/WebMVC/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Web/WebMVC/Views/Shared/_Layout.cshtml b/src/Web/WebMVC/Views/Shared/_Layout.cshtml index d26208833..ee0c724c4 100644 --- a/src/Web/WebMVC/Views/Shared/_Layout.cshtml +++ b/src/Web/WebMVC/Views/Shared/_Layout.cshtml @@ -102,7 +102,6 @@ function stablishConnection(cb) { let connection = new signalR.HubConnectionBuilder() .withUrl('@settings.Value.SignalrHubUrl/hub/notificationhub', { - transport: signalR.HttpTransportType.LongPolling, accessTokenFactory: () => { return "Authorization", getToken(); } diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index bdbb29924..16a094ab9 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3 ..\..\..\docker-compose.dcproj 3.0 @@ -23,26 +23,26 @@ - - - - - + + + + + - - + + - - - - + + + + - - + + - + diff --git a/src/Web/WebSPA/Client/modules/shared/services/signalr.service.ts b/src/Web/WebSPA/Client/modules/shared/services/signalr.service.ts index ab8642656..680ee06e9 100644 --- a/src/Web/WebSPA/Client/modules/shared/services/signalr.service.ts +++ b/src/Web/WebSPA/Client/modules/shared/services/signalr.service.ts @@ -43,7 +43,6 @@ export class SignalrService { private register() { this._hubConnection = new HubConnectionBuilder() .withUrl(this.SignalrHubUrl + '/hub/notificationhub', { - transport: HttpTransportType.LongPolling, accessTokenFactory: () => this.securityService.GetToken() }) .configureLogging(LogLevel.Information) diff --git a/src/Web/WebSPA/Dockerfile b/src/Web/WebSPA/Dockerfile index acb039fe7..75a7d8a74 100644 --- a/src/Web/WebSPA/Dockerfile +++ b/src/Web/WebSPA/Dockerfile @@ -1,5 +1,5 @@ ARG NODE_IMAGE=node:8.11 -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 @@ -11,7 +11,7 @@ RUN npm install COPY Web/WebSPA . RUN npm run build:prod -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Web/WebSPA/WebSPA.csproj b/src/Web/WebSPA/WebSPA.csproj index baefec967..ff161ddc3 100644 --- a/src/Web/WebSPA/WebSPA.csproj +++ b/src/Web/WebSPA/WebSPA.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119 ..\..\..\docker-compose.dcproj false @@ -87,17 +87,17 @@ - - - - + + + + - - - - + + + + diff --git a/src/Web/WebStatus/Dockerfile b/src/Web/WebStatus/Dockerfile index b027268ba..acba370fe 100644 --- a/src/Web/WebStatus/Dockerfile +++ b/src/Web/WebStatus/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 39d454473..ecdf92b15 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -1,6 +1,6 @@  - netcoreapp3.0 + netcoreapp3.1 $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; ..\..\..\docker-compose.dcproj true @@ -8,22 +8,22 @@ - - - - - + + + + + - - - - + + + + - - + + - + diff --git a/src/Web/WebhookClient/Dockerfile b/src/Web/WebhookClient/Dockerfile index bce6a4f54..f0511b302 100644 --- a/src/Web/WebhookClient/Dockerfile +++ b/src/Web/WebhookClient/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWebApps.sln" diff --git a/src/Web/WebhookClient/WebhookClient.csproj b/src/Web/WebhookClient/WebhookClient.csproj index 7c67bced2..fbb9f7af9 100644 --- a/src/Web/WebhookClient/WebhookClient.csproj +++ b/src/Web/WebhookClient/WebhookClient.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 InProcess Linux 36215d41-f31a-4aa6-9929-bd67d650e7b5 @@ -13,9 +13,9 @@ - + - +