diff --git a/README.md b/README.md
index a0d988099..d92fa9a52 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,26 @@
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
-**Note Visual Studio 2017 version required**: This is important as of Oct. 11th 2017. For working with Docker and docker-compose files (needed with eShopOnContainers), do not migrate to VS 2017 15.4 as it has a bug when using TAGs in the docker-compose files.
-Please, either use VS 2017 15.35 or VS 2017 15.5 Preview 1 (bug is fixed here) or later.
+**Note Visual Studio 2017 version required**: This is important as of November 2017. For working with Docker and docker-compose files (needed with eShopOnContainers), do not migrate to VS 2017 15.4 as it has a bug when using TAGs in the docker-compose files.
+Please, either use VS 2017 15.35 or VS 2017 15.5 Preview (bug is fixed here) or later.
VS Preview installs next to your stable Visual Studio IDE, allowing you to use either independently.
Download of Preview here: https://www.visualstudio.com/vs/preview/
**Note for Pull Requests**: We accept pull request from the community. When doing it, please do it onto the DEV branch which is the consolidated work-in-progress branch. Do not request it onto Master, if possible.
-## Moving to .NET Core 2.0 "wave"
-NOTE: During August/September 2017 we'll be moving the solution to .NET Core "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions.
+## Updated for .NET Core 2.0 "wave" of technologies
+NOTE: We have migrated the whole solution to .NET Core 2.0 "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions.
+For a list on the new .NET Core 2.0 related implemented features, see this [blog post](https://blogs.msdn.microsoft.com/dotnet/2017/08/02/microservices-and-docker-containers-architecture-patterns-and-development-guidance/).
>**PLEASE** Read our [branch guide](./branch-guide.md) to know about our branching policy
> ### DISCLAIMER
-> **IMPORTANT:** The current state of this sample application is **BETA**, consider it version 0.1, a foundational version. Therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
+> **IMPORTANT:** The current state of this sample application is **BETA**, because we are constantly evolving towards new released technologies. Therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
>
> This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. The chosen domain is an eShop/eCommerce but simply because it is a well-know domain by most people/developers.
However, this sample application should not be considered as an "eCommerce reference model", at all. The implemented business domain might not be ideal from an eCommerce business point of view. It is neither trying to solve all the problems in a large, scalable and mission-critical distributed system. It is just a bootstrap for developers to easily get started in the world of Docker containers and microservices with .NET Core.
->
For example, the next step (still not covered in eShopOnContainers) after understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Docker Swarm, Kubernetes or DC/OS (in Azure Container Service) or Azure Service Fabric which in most of the cases will require additional partial changes to your application's configuration (although the present architecture should work on most orchestrators with small changes).
-> Additional steps would be to move your databases to HA cloud services, or to implement your EventBus with Azure Service Bus or any other production ready Service Bus in the market.
->
In the future we might fork this project and make multiple versions targeting specific microservice cluster/orchestrators plus using additional cloud infrastructure.
+>
For example, the next step after running the solution in the local dev PC and understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Kubernetes in Azure or Azure Service Fabric, both environments tested and supported by this solution.
+> Additional steps would be to move your databases to HA cloud services (like Azure SQL Database), or to implement your EventBus with Azure Service Bus or any other production ready Service Bus in the market.
+>
>
> Read the planned Roadmap and Milestones for future releases of eShopOnContainers within the Wiki for further info about possible new implementations and provide feedback at the ISSUES section if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue.
@@ -59,11 +60,13 @@ You can download them and start reviewing these Guides/eBooks here:
| Architecting & Developing | Containers Lifecycle & CI/CD | App patterns with Xamarin.Forms |
| ------------ | ------------| ------------|
| | | |
-| **Download** (First Edition) | **Download** (First Edition) | **Download** (First Edition) |
+| **Download .PDF** (2nd Edition) | **Download** (First Edition) | **Download** (First Edition) |
+
+Download in other formats (**eReaders** like **MOBI**, **EPUB**) and other eBooks at the [.NET Architecture center](dot.net/architecture).
Send feedback to [dotnet-architecture-ebooks-feedback@service.microsoft.com](dotnet-architecture-ebooks-feedback@service.microsoft.com)
-
-However, we encourage to download and review the "Architecting & Developing eBook" because the architectural styles and architectural patterns and technologies explained in the guidance are using this reference application when explaining many pattern implementations, so you'll understand much better the context, design and decisions taken in the current architecture and internal designs.
+
+However, we encourage to download and review the [Architecting and Developing Microservices eBook](https://aka.ms/microservicesebook) because the architectural styles and architectural patterns and technologies explained in the guidance are using this reference application when explaining many pattern implementations, so you'll understand much better the context, design and decisions taken in the current architecture and internal designs.
## Overview of the application code
In this repo you can find a sample reference application that will help you to understand how to implement a microservice architecture based application using .NET Core and Docker.
@@ -82,7 +85,7 @@ Finally, those microservices are consumed by multiple client web and mobile apps
*MVC Application (ASP.NET Core)*: It's an MVC application where you can find interesting scenarios on how to consume HTTP-based microservices from C# running in the server side, as it is a typical ASP.NET Core MVC application. Since it is a server-side application, access to other containers/microservices is done within the internal Docker Host network with its internal name resolution.
-*SPA (Single Page Application)*: Providing similar "eShop business functionality" but developed with Angular 2, Typescript and slightly using ASP.NET Core MVC. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet).
+*SPA (Single Page Application)*: Providing similar "eShop business functionality" but developed with Angular, Typescript and slightly using ASP.NET Core MVC. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet).
*Xamarin Mobile App (For iOS, Android and Windows/UWP)*: It is a client mobile app supporting the most common mobile OS platforms (iOS, Android and Windows/UWP). In this case, the consumption of the microservices is done from C# but running on the client devices, so out of the Docker Host internal network (Like from your network or even the Internet).
@@ -99,12 +102,11 @@ For those who prefer the CLI on Windows, using dotnet CLI, docker CLI and VS Cod
https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)
### CLI and Mac based
-For those who prefer the CLI on a Mac, using dotnet CLI, docker CLI and VS Code for Mac
-(Instructions still TBD, but similar to Windows CLI):
-https://github.com/dotnet/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-Code-and-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
+For those who prefer the CLI on a Mac, using dotnet CLI, docker CLI and VS Code for Mac:
+https://github.com/dotnet-architecture/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-for-Mac-or-with-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
## Orchestrators: Kubernetes and Service Fabric
-See at the Wiki the posts on setup/instructions about how to deploy to Kubernetes or Service Fabric in Azure (although you could also deploy to any other cloud or on-premises).
+See at the [Wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki) the posts on setup/instructions about how to deploy to Kubernetes or Service Fabric in Azure (although you could also deploy to any other cloud or on-premises).
## Sending feedback and pull requests
As mentioned, we'd appreciate your feedback, improvements and ideas.
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)-v1.pdf b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)-v1.pdf
new file mode 100644
index 000000000..7f5d6885d
Binary files /dev/null and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)-v1.pdf differ
diff --git a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook).pdf b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook).pdf
index 7f5d6885d..4636e3cf4 100644
Binary files a/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook).pdf and b/docs/NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook).pdf differ
diff --git a/img/eShopOnContainers_Architecture_Diagram - Old3.png b/img/eShopOnContainers_Architecture_Diagram - Old3.png
new file mode 100644
index 000000000..91609b987
Binary files /dev/null and b/img/eShopOnContainers_Architecture_Diagram - Old3.png differ
diff --git a/img/eShopOnContainers_Architecture_Diagram.png b/img/eShopOnContainers_Architecture_Diagram.png
index 91609b987..991691e4a 100644
Binary files a/img/eShopOnContainers_Architecture_Diagram.png and b/img/eShopOnContainers_Architecture_Diagram.png differ
diff --git a/img/ebook_arch_dev_microservices_containers_cover.png b/img/ebook_arch_dev_microservices_containers_cover.png
index 3677dafd2..261aa566c 100644
Binary files a/img/ebook_arch_dev_microservices_containers_cover.png and b/img/ebook_arch_dev_microservices_containers_cover.png differ
diff --git a/img/ebook_arch_dev_microservices_containers_cover_V1.png b/img/ebook_arch_dev_microservices_containers_cover_V1.png
new file mode 100644
index 000000000..3677dafd2
Binary files /dev/null and b/img/ebook_arch_dev_microservices_containers_cover_V1.png differ
diff --git a/img/exploring-to-production-ready.png b/img/exploring-to-production-ready.png
index f6d1dd672..b2fedbdfc 100644
Binary files a/img/exploring-to-production-ready.png and b/img/exploring-to-production-ready.png differ
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs
index 5035d557a..bc807db52 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml.cs
@@ -23,7 +23,7 @@ namespace eShopOnContainers
InitApp();
- if (Device.RuntimePlatform == Device.Windows)
+ if (Device.RuntimePlatform == Device.UWP)
{
InitNavigation();
}
@@ -46,7 +46,7 @@ namespace eShopOnContainers
{
base.OnStart();
- if (Device.RuntimePlatform != Device.Windows)
+ if (Device.RuntimePlatform != Device.UWP)
{
await InitNavigation();
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs
index 850d0242e..60a13af1e 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Basket/BasketMockService.cs
@@ -13,8 +13,8 @@ namespace eShopOnContainers.Core.Services.Basket
BuyerId = "9245fe4a-d402-451c-b9ed-9c1a04247482",
Items = new List
{
- new BasketItem { Id = "1", PictureUrl = Device.RuntimePlatform != Device.Windows ? "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.Windows ? "fake_product_04.png" : "Assets/fake_product_04.png", ProductId = Common.Common.MockCatalogItemId04, ProductName = ".NET Black Cupt", Quantity = 1, UnitPrice = 17.00M }
+ 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 }
}
};
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
index e37521d83..213b083f2 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Catalog/CatalogMockService.cs
@@ -24,11 +24,11 @@ namespace eShopOnContainers.Core.Services.Catalog
private ObservableCollection MockCatalog = new ObservableCollection
{
- new CatalogItem { Id = Common.Common.MockCatalogItemId01, PictureUri = Device.RuntimePlatform != Device.Windows ? "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.Windows ? "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.Windows ? "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.Windows ? "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.Windows ? "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" }
+ 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()
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs
index c4536ac51..edfde78fa 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Marketing/CampaignMockService.cs
@@ -14,7 +14,7 @@ namespace eShopOnContainers.Core.Services.Marketing
new CampaignItem
{
Id = Common.Common.MockCampaignId01,
- PictureUri = Device.RuntimePlatform != Device.Windows
+ PictureUri = Device.RuntimePlatform != Device.UWP
? "fake_campaign_01.png"
: "Assets/fake_campaign_01.png",
Name = ".NET Bot Black Hoodie 50% OFF",
@@ -26,7 +26,7 @@ namespace eShopOnContainers.Core.Services.Marketing
new CampaignItem
{
Id = Common.Common.MockCampaignId02,
- PictureUri = Device.RuntimePlatform != Device.Windows
+ PictureUri = Device.RuntimePlatform != Device.UWP
? "fake_campaign_02.png"
: "Assets/fake_campaign_02.png",
Name = "Roslyn Red T-Shirt 3x2",
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs
index 9d25edc65..5fdc7c281 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Services/Order/OrderMockService.cs
@@ -55,8 +55,8 @@ namespace eShopOnContainers.Core.Services.Order
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.Windows ? "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.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png" }
+ 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()
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/LoginView.xaml.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/LoginView.xaml.cs
index ef6cb1ade..0cd3f06f9 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/LoginView.xaml.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/LoginView.xaml.cs
@@ -41,7 +41,7 @@ namespace eShopOnContainers.Core.Views
public async Task AnimateIn()
{
- if (Device.RuntimePlatform == Device.Windows)
+ if (Device.RuntimePlatform == Device.UWP)
{
return;
}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/project.json b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/project.json
index a832cc982..17f816122 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/project.json
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/project.json
@@ -16,7 +16,7 @@
"Xam.Plugins.Settings": "2.6.0.12-beta",
"Xamarin.FFImageLoading": "2.2.9",
"Xamarin.FFImageLoading.Forms": "2.2.9",
- "Xamarin.Forms": "2.3.4.231"
+ "Xamarin.Forms": "2.5.0.91635"
},
"frameworks": {
".NETPortable,Version=v4.5,Profile=Profile111": {}
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Properties/AndroidManifest.xml b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Properties/AndroidManifest.xml
index f778d5fa5..4443cdd5f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Properties/AndroidManifest.xml
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Properties/AndroidManifest.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs
index ecce1f7e5..455249677 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/Renderers/CustomTabbedPageRenderer.cs
@@ -18,10 +18,10 @@ namespace eShopOnContainers.Droid.Renderers
{
public class CustomTabbedPageRenderer : TabbedPageRenderer
{
- private const int DeleayBeforeTabAdded = 10;
+ private const int DelayBeforeTabAdded = 10;
protected readonly Dictionary BadgeViews = new Dictionary();
private TabLayout _tabLayout;
- private TabLayout.SlidingTabStrip _tabStrip;
+ private LinearLayout _tabStrip;
private ViewPager _viewPager;
private TabbedPage _tabbedPage;
private bool _firstTime = true;
@@ -29,7 +29,7 @@ namespace eShopOnContainers.Droid.Renderers
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
-
+
_tabLayout = ViewGroup.FindChildOfType();
if (_tabLayout == null)
@@ -37,34 +37,18 @@ namespace eShopOnContainers.Droid.Renderers
Console.WriteLine("No TabLayout found. Badge not added.");
return;
}
-
+
_tabbedPage = e.NewElement as TabbedPage;
_viewPager = (ViewPager)GetChildAt(0);
- _tabLayout.TabSelected += (s, a) =>
+ _tabLayout.TabSelected += (s, a) =>
{
var page = _tabbedPage.Children[a.Tab.Position];
-
- if (page is TabbedPage)
- {
- var tabPage = (TabbedPage)page;
- SetTab(a.Tab, tabPage.Icon.File);
- }
-
+ SetTab(a.Tab, page.Icon.File);
_viewPager.SetCurrentItem(a.Tab.Position, false);
};
- _tabLayout.TabUnselected += (s, a) =>
- {
- var page = _tabbedPage.Children[a.Tab.Position];
-
- if (page is TabbedPage)
- {
- SetTab(a.Tab, page.Icon.File);
- }
- };
-
- _tabStrip = _tabLayout.FindChildOfType();
+ _tabStrip = _tabLayout.FindChildOfType();
for (var i = 0; i < _tabLayout.TabCount; i++)
{
@@ -81,7 +65,7 @@ namespace eShopOnContainers.Droid.Renderers
{
int id = Resources.GetIdentifier(name, "drawable", Context.PackageName);
tab.SetIcon(null);
-
+
LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
linearLayoutParams.SetMargins(0, -48, 0, 0);
@@ -89,7 +73,7 @@ namespace eShopOnContainers.Droid.Renderers
img.LayoutParameters = linearLayoutParams;
img.SetPadding(0, 0, 0, 48);
img.SetImageResource(id);
-
+
tab.SetCustomView(img);
}
catch (Exception ex)
@@ -115,7 +99,6 @@ namespace eShopOnContainers.Droid.Renderers
if (page is TabbedPage)
{
var tabbedPage = (TabbedPage)page;
-
SetTab(tab, tabbedPage.Icon.File);
}
else
@@ -164,7 +147,7 @@ namespace eShopOnContainers.Droid.Renderers
{
badgeView.BadgeColor = tabColor.ToAndroid();
}
-
+
element.PropertyChanged += OnTabbedPagePropertyChanged;
}
@@ -200,7 +183,7 @@ namespace eShopOnContainers.Droid.Renderers
private async void OnTabAdded(object sender, ElementEventArgs e)
{
- await Task.Delay(DeleayBeforeTabAdded);
+ await Task.Delay(DelayBeforeTabAdded);
var page = e.Element as Page;
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
index 46eefe5c2..4af4a9a3f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/eShopOnContainers.Droid.csproj
@@ -1,5 +1,6 @@
+
Debug
AnyCPU
@@ -16,8 +17,8 @@
Resources\Resource.Designer.cs
Off
Properties\AndroidManifest.xml
- False
- v6.0
+ true
+ v8.0
armeabi,armeabi-v7a,x86
@@ -42,6 +43,7 @@
False
1G
Xamarin
+ armeabi;armeabi-v7a;x86
pdbonly
@@ -58,14 +60,6 @@
..\..\..\..\packages\Acr.Support.2.1.0\lib\MonoAndroid10\Acr.Support.Android.dll
True
-
- ..\..\..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.dll
- True
-
-
- ..\..\..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll
- True
-
..\..\..\..\packages\AndHUD.1.2.0\lib\MonoAndroid\AndHUD.dll
True
@@ -73,12 +67,6 @@
..\..\..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\MonoAndroid10\FFImageLoading.dll
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.dll
-
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll
-
..\..\..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\MonoAndroid10\FFImageLoading.Platform.dll
@@ -166,56 +154,84 @@
..\..\..\..\packages\Validation.2.2.8\lib\dotnet\Validation.dll
-
- ..\..\..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
- True
+
+
+ ..\..\..\..\packages\Autofac.4.5.0\lib\netstandard1.1\Autofac.dll
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
- True
+
+ ..\..\..\..\packages\Acr.UserDialogs.6.3.8\lib\MonoAndroid10\Acr.UserDialogs.dll
-
- ..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
- True
+
+ ..\..\..\..\packages\Acr.UserDialogs.6.3.8\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\FormsViewGroup.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\FormsViewGroup.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Core.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Core.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
-
-
- ..\..\..\..\packages\Autofac.4.5.0\lib\netstandard1.1\Autofac.dll
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.dll
+
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.RecyclerView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.RecyclerView.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Annotations.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Annotations.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Compat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.CardView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.CardView.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Media.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Media.Compat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Core.UI.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.UI.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Core.Utils.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.Utils.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Fragment.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Fragment.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Design.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Design.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Transition.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Transition.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v4.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v4.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.Palette.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.Palette.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.AppCompat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll
@@ -387,14 +403,27 @@
-
This project references NuGet package(s) that are missing on this computer. Use 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/eShopOnContainers/eShopOnContainers.Droid/packages.config b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/packages.config
index 1b96855ee..08c447821 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/packages.config
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Droid/packages.config
@@ -1,7 +1,7 @@
-
+
@@ -71,15 +71,23 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/eShopOnContainers.TestRunner.Droid.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/eShopOnContainers.TestRunner.Droid.csproj
index 326158569..9fc51542f 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/eShopOnContainers.TestRunner.Droid.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/eShopOnContainers.TestRunner.Droid.csproj
@@ -1,5 +1,6 @@
+
Debug
AnyCPU
@@ -15,8 +16,8 @@
true
Resources\Resource.Designer.cs
Off
- False
- v6.0
+ true
+ v8.0
Properties\AndroidManifest.xml
@@ -46,9 +47,6 @@
False
-
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\FormsViewGroup.dll
-
@@ -94,50 +92,6 @@
..\..\..\..\packages\Validation.2.2.8\lib\dotnet\Validation.dll
-
- ..\..\..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
- True
-
-
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Core.dll
-
-
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
-
-
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
-
-
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
-
..\..\..\..\packages\xunit.abstractions.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.abstractions.dll
@@ -150,9 +104,6 @@
..\..\..\..\packages\xunit.runner.utility.2.1.0\lib\dotnet\xunit.runner.utility.dotnet.dll
-
- ..\..\..\..\packages\xunit.runner.devices.2.1.0\lib\MonoAndroid\xunit.runner.devices.dll
-
..\..\..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll
@@ -185,12 +136,6 @@
..\..\..\..\packages\Splat.1.6.2\lib\monoandroid\Splat.dll
-
- ..\..\..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.dll
-
-
- ..\..\..\..\packages\Acr.UserDialogs.6.3.3\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll
-
..\..\..\..\packages\IdentityModel.1.3.1\lib\portable-net45+wp80+win8+wpa81\IdentityModel.Portable.dll
@@ -200,18 +145,90 @@
..\..\..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\MonoAndroid10\FFImageLoading.Platform.dll
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.dll
-
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll
-
..\..\..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\ModernHttpClient.dll
..\..\..\..\packages\modernhttpclient.2.4.2\lib\MonoAndroid\OkHttp.dll
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Annotations.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Annotations.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Compat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Core.UI.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.UI.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Core.Utils.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.Utils.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Media.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Media.Compat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Fragment.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Fragment.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Transition.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Transition.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v4.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v4.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.CardView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.CardView.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.Palette.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.Palette.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.RecyclerView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.RecyclerView.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.AppCompat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.Design.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Design.dll
+
+
+ ..\..\..\..\packages\Acr.UserDialogs.6.3.8\lib\MonoAndroid10\Acr.UserDialogs.dll
+
+
+ ..\..\..\..\packages\Acr.UserDialogs.6.3.8\lib\MonoAndroid10\Acr.UserDialogs.Interface.dll
+
+
+ ..\..\..\..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll
+
+
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\FormsViewGroup.dll
+
+
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Core.dll
+
+
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
+
+
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
+
+
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
+
+
+ ..\..\..\..\packages\xunit.runner.devices.2.1.0\lib\MonoAndroid\xunit.runner.devices.dll
+
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.dll
+
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\MonoAndroid10\FFImageLoading.Forms.Droid.dll
+
@@ -243,27 +260,27 @@
- {f7b6a162-bc4d-4924-b16a-713f9b0344e7}
+ {6E4285E7-7611-4440-A1B5-3513EBB13807}
eShopOnContainers.UnitTests
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use 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/eShopOnContainers/eShopOnContainers.TestRunner.Droid/packages.config b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/packages.config
index ac1665a2c..edb63a00d 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/packages.config
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Droid/packages.config
@@ -1,7 +1,7 @@
-
+
@@ -68,22 +68,30 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Windows/project.json b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Windows/project.json
index f32fb6319..a9e8dffca 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Windows/project.json
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.Windows/project.json
@@ -1,11 +1,11 @@
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.3.3",
- "Xamarin.Forms": "2.3.4.231",
+ "Xamarin.Forms": "2.5.0.91635",
"xunit.runner.devices": "2.1.0"
},
"frameworks": {
- "uap10.0": {}
+ "uap10.0.10586": {}
},
"runtimes": {
"win10-arm": {},
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj
index 78410457a..a9f11f6b9 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/eShopOnContainers.TestRunner.iOS.csproj
@@ -1,5 +1,6 @@
+
Debug
iPhoneSimulator
@@ -137,16 +138,16 @@
..\..\..\..\packages\Validation.2.2.8\lib\dotnet\Validation.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
@@ -237,13 +238,14 @@
+
+
This project references NuGet package(s) that are missing on this computer. Use 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/eShopOnContainers/eShopOnContainers.TestRunner.iOS/packages.config b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/packages.config
index 3625caa87..c578f779e 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/packages.config
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.TestRunner.iOS/packages.config
@@ -68,7 +68,7 @@
-
+
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/Services/CatalogServiceTests.cs b/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/Services/CatalogServiceTests.cs
index bc3d2691b..75045d36b 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/Services/CatalogServiceTests.cs
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/Services/CatalogServiceTests.cs
@@ -1,5 +1,4 @@
using eShopOnContainers.Core.Services.Catalog;
-using eShopOnContainers.Core.Services.RequestProvider;
using System.Threading.Tasks;
using Xunit;
@@ -16,16 +15,6 @@ namespace eShopOnContainers.UnitTests
Assert.NotEqual(0, catalog.Count);
}
- [Fact]
- public async Task GetCatalogTest()
- {
- var requestProvider = new RequestProvider();
- var catalogService = new CatalogService(requestProvider);
- var catalog = await catalogService.GetCatalogAsync();
-
- Assert.NotEqual(0, catalog.Count);
- }
-
[Fact]
public async Task GetFakeCatalogBrandTest()
{
@@ -35,16 +24,6 @@ namespace eShopOnContainers.UnitTests
Assert.NotEqual(0, catalogBrand.Count);
}
- [Fact]
- public async Task GetCatalogBrandTest()
- {
- var requestProvider = new RequestProvider();
- var catalogService = new CatalogService(requestProvider);
- var catalogBrand = await catalogService.GetCatalogBrandAsync();
-
- Assert.NotEqual(0, catalogBrand.Count);
- }
-
[Fact]
public async Task GetFakeCatalogTypeTest()
{
@@ -53,15 +32,5 @@ namespace eShopOnContainers.UnitTests
Assert.NotEqual(0, catalogType.Count);
}
-
- [Fact]
- public async Task GetCatalogTypeTest()
- {
- var requestProvider = new RequestProvider();
- var catalogService = new CatalogService(requestProvider);
- var catalogType = await catalogService.GetCatalogTypeAsync();
-
- Assert.NotEqual(0, catalogType.Count);
- }
}
}
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/project.json b/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/project.json
index 7c3248428..6bd8da4a8 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/project.json
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.UnitTests/project.json
@@ -1,6 +1,6 @@
{
"dependencies": {
- "Xamarin.Forms": "2.3.4.231",
+ "Xamarin.Forms": "2.5.0.91635",
"xunit": "2.2.0",
"xunit.runner.console": "2.2.0"
},
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/project.json b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/project.json
index faafe1f18..3c49f4852 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/project.json
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Windows/project.json
@@ -10,10 +10,10 @@
"Xam.Plugins.Settings": "2.6.0.12-beta",
"Xamarin.FFImageLoading": "2.2.9",
"Xamarin.FFImageLoading.Forms": "2.2.9",
- "Xamarin.Forms": "2.3.4.231"
+ "Xamarin.Forms": "2.5.0.91635"
},
"frameworks": {
- "uap10.0": {}
+ "uap10.0.10586": {}
},
"runtimes": {
"win10-arm": {},
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
index 9387a3213..7887d6f2d 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/eShopOnContainers.iOS.csproj
@@ -1,5 +1,6 @@
+
Debug
iPhoneSimulator
@@ -150,12 +151,6 @@
..\..\..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\Xamarin.iOS10\FFImageLoading.dll
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.dll
-
-
- ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.Touch.dll
-
..\..\..\..\packages\Xamarin.FFImageLoading.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Platform.dll
@@ -229,23 +224,29 @@
..\..\..\..\packages\Autofac.4.5.0\lib\netstandard1.1\Autofac.dll
+
+ ..\..\..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\Xamarin.iOS10\Plugin.Geolocator.Abstractions.dll
+
+
+ ..\..\..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\Xamarin.iOS10\Plugin.Geolocator.dll
+
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
- ..\..\..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
+ ..\..\..\..\packages\Xamarin.Forms.2.5.0.91635\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
-
- ..\..\..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\Xamarin.iOS10\Plugin.Geolocator.Abstractions.dll
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.dll
-
- ..\..\..\..\packages\Xam.Plugin.Geolocator.3.0.4\lib\Xamarin.iOS10\Plugin.Geolocator.dll
+
+ ..\..\..\..\packages\Xamarin.FFImageLoading.Forms.2.2.9\lib\Xamarin.iOS10\FFImageLoading.Forms.Touch.dll
@@ -447,5 +448,5 @@
-
+
\ No newline at end of file
diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/packages.config b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/packages.config
index 0765f47f9..c8179599b 100644
--- a/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/packages.config
+++ b/src/Mobile/eShopOnContainers/eShopOnContainers.iOS/packages.config
@@ -68,5 +68,5 @@
-
+
\ No newline at end of file
diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs
index f8ea7ad40..a6d482c26 100644
--- a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs
@@ -9,18 +9,7 @@ using System.Threading.Tasks;
namespace Ordering.API.Application.Commands
{
- public class CancelOrderCommandIdentifiedHandler : IdentifierCommandHandler
- {
- public CancelOrderCommandIdentifiedHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
- {
- }
-
- protected override bool CreateResultForDuplicateRequest()
- {
- return true; // Ignore duplicate requests for processing order.
- }
- }
-
+ // Regular CommandHandler
public class CancelOrderCommandHandler : IAsyncRequestHandler
{
private readonly IOrderRepository _orderRepository;
@@ -43,4 +32,18 @@ namespace Ordering.API.Application.Commands
return await _orderRepository.UnitOfWork.SaveEntitiesAsync();
}
}
+
+
+ // Use for Idempotency in Command process
+ public class CancelOrderIdentifiedCommandHandler : IdentifiedCommandHandler
+ {
+ public CancelOrderIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
+ {
+ }
+
+ protected override bool CreateResultForDuplicateRequest()
+ {
+ return true; // Ignore duplicate requests for processing order.
+ }
+ }
}
diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs
index 938f80a9c..845caf010 100644
--- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs
@@ -7,19 +7,7 @@
using System;
using System.Threading.Tasks;
-
- public class CreateOrderCommandIdentifiedHandler : IdentifierCommandHandler
- {
- public CreateOrderCommandIdentifiedHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
- {
- }
-
- protected override bool CreateResultForDuplicateRequest()
- {
- return true; // Ignore duplicate requests for creating order.
- }
- }
-
+ // Regular CommandHandler
public class CreateOrderCommandHandler
: IAsyncRequestHandler
{
@@ -55,4 +43,18 @@
.SaveEntitiesAsync();
}
}
+
+
+ // Use for Idempotency in Command process
+ public class CreateOrderIdentifiedCommandHandler : IdentifiedCommandHandler
+ {
+ public CreateOrderIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
+ {
+ }
+
+ protected override bool CreateResultForDuplicateRequest()
+ {
+ return true; // Ignore duplicate requests for creating order.
+ }
+ }
}
diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/IdentifierCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs
similarity index 90%
rename from src/Services/Ordering/Ordering.API/Application/Commands/IdentifierCommandHandler.cs
rename to src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs
index 3fe07c124..507595236 100644
--- a/src/Services/Ordering/Ordering.API/Application/Commands/IdentifierCommandHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs
@@ -10,13 +10,13 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
///
/// Type of the command handler that performs the operation if request is not duplicated
/// Return value of the inner command handler
- public class IdentifierCommandHandler : IAsyncRequestHandler, R>
+ public class IdentifiedCommandHandler : IAsyncRequestHandler, R>
where T : IRequest
{
private readonly IMediator _mediator;
private readonly IRequestManager _requestManager;
- public IdentifierCommandHandler(IMediator mediator, IRequestManager requestManager)
+ public IdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager)
{
_mediator = mediator;
_requestManager = requestManager;
@@ -48,6 +48,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
{
await _requestManager.CreateRequestForCommandAsync(message.Id);
+ // Send the embeded business command to mediator so it runs its related CommandHandler
var result = await _mediator.Send(message.Command);
return result;
diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommandHandler.cs
index 47f1f5d54..d1fa6a71b 100644
--- a/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommandHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommandHandler.cs
@@ -6,18 +6,7 @@ using System.Threading.Tasks;
namespace Ordering.API.Application.Commands
{
- public class ShipOrderCommandIdentifiedHandler : IdentifierCommandHandler
- {
- public ShipOrderCommandIdentifiedHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
- {
- }
-
- protected override bool CreateResultForDuplicateRequest()
- {
- return true; // Ignore duplicate requests for processing order.
- }
- }
-
+ // Regular CommandHandler
public class ShipOrderCommandHandler : IAsyncRequestHandler
{
private readonly IOrderRepository _orderRepository;
@@ -40,4 +29,18 @@ namespace Ordering.API.Application.Commands
return await _orderRepository.UnitOfWork.SaveEntitiesAsync();
}
}
+
+
+ // Use for Idempotency in Command process
+ public class ShipOrderIdentifiedCommandHandler : IdentifiedCommandHandler
+ {
+ public ShipOrderIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager)
+ {
+ }
+
+ protected override bool CreateResultForDuplicateRequest()
+ {
+ return true; // Ignore duplicate requests for processing order.
+ }
+ }
}
diff --git a/src/Services/Ordering/Ordering.API/Application/Validations/IdentifierCommandValidator.cs b/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs
similarity index 73%
rename from src/Services/Ordering/Ordering.API/Application/Validations/IdentifierCommandValidator.cs
rename to src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs
index e1482287f..84ae48835 100644
--- a/src/Services/Ordering/Ordering.API/Application/Validations/IdentifierCommandValidator.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs
@@ -3,9 +3,9 @@ using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
namespace Ordering.API.Application.Validations
{
- public class IdentifierCommandValidator : AbstractValidator>
+ public class IdentifiedCommandValidator : AbstractValidator>
{
- public IdentifierCommandValidator()
+ public IdentifiedCommandValidator()
{
RuleFor(command => command.Id).NotEmpty();
}
diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/BackgroundService.cs b/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/BackgroundService.cs
new file mode 100644
index 000000000..205b3c75a
--- /dev/null
+++ b/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/BackgroundService.cs
@@ -0,0 +1,83 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+using Microsoft.Extensions.Hosting;
+
+namespace Ordering.API.Infrastructure.HostedServices
+{
+ // Copyright (c) .NET Foundation. All rights reserved.
+ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+ ///
+ /// Base class for implementing a long running .
+ /// IMPORTANT: This base class is implemented in .NET Core 2.1 - Since this microservice is still in .NET Core 2.0, we're using the class within the project
+ /// When .NET Core 2.1 is released, this class should be removed and you should use the use implemented by the framework
+ /// https://github.com/aspnet/Hosting/blob/712c992ca827576c05923e6a134ca0bec87af4df/src/Microsoft.Extensions.Hosting.Abstractions/BackgroundService.cs
+ ///
+ ///
+ public abstract class BackgroundService : IHostedService, IDisposable
+ {
+ private Task _executingTask;
+ private readonly CancellationTokenSource _stoppingCts = new CancellationTokenSource();
+
+ ///
+ /// This method is called when the starts. The implementation should return a task that represents
+ /// the lifetime of the long running operation(s) being performed.
+ ///
+ /// Triggered when is called.
+ /// A that represents the long running operations.
+ protected abstract Task ExecuteAsync(CancellationToken stoppingToken);
+
+ ///
+ /// Triggered when the application host is ready to start the service.
+ ///
+ /// Indicates that the start process has been aborted.
+ public virtual Task StartAsync(CancellationToken cancellationToken)
+ {
+ // Store the task we're executing
+ _executingTask = ExecuteAsync(_stoppingCts.Token);
+
+ // If the task is completed then return it, this will bubble cancellation and failure to the caller
+ if (_executingTask.IsCompleted)
+ {
+ return _executingTask;
+ }
+
+ // Otherwise it's running
+ return Task.CompletedTask;
+ }
+
+ ///
+ /// Triggered when the application host is performing a graceful shutdown.
+ ///
+ /// Indicates that the shutdown process should no longer be graceful.
+ public virtual async Task StopAsync(CancellationToken cancellationToken)
+ {
+ // Stop called without start
+ if (_executingTask == null)
+ {
+ return;
+ }
+
+ try
+ {
+ // Signal cancellation to the executing method
+ _stoppingCts.Cancel();
+ }
+ finally
+ {
+ // Wait until the task completes or the stop token triggers
+ await Task.WhenAny(_executingTask, Task.Delay(Timeout.Infinite, cancellationToken));
+ }
+
+ }
+
+ public virtual void Dispose()
+ {
+ _stoppingCts.Cancel();
+ }
+ }
+
+
+}
diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/GracePeriodManagerService.cs b/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/GracePeriodManagerService.cs
index 3fa70e20b..52b1b2da7 100644
--- a/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/GracePeriodManagerService.cs
+++ b/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/GracePeriodManagerService.cs
@@ -12,8 +12,7 @@
using System.Threading;
using System.Threading.Tasks;
- public class GracePeriodManagerService
- : HostedService
+ public class GracePeriodManagerService : BackgroundService
{
private readonly OrderingSettings _settings;
private readonly ILogger _logger;
@@ -25,27 +24,28 @@
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus));
-
_settings = settings?.Value ?? throw new ArgumentNullException(nameof(settings));
}
- protected override async Task ExecuteAsync(CancellationToken cancellationToken)
+ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
- while (true)
+ _logger.LogDebug($"GracePeriod background task is starting.");
+
+ stoppingToken.Register(() => _logger.LogDebug($"#1 GracePeriod background task is stopping."));
+
+ while (!stoppingToken.IsCancellationRequested)
{
- if (cancellationToken.IsCancellationRequested)
- {
- break;
- }
+ _logger.LogDebug($"GracePeriod background task is doing background work.");
CheckConfirmedGracePeriodOrders();
- await Task.Delay(_settings.CheckUpdateTime, cancellationToken);
+ await Task.Delay(_settings.CheckUpdateTime, stoppingToken);
continue;
}
- await Task.CompletedTask;
+ _logger.LogDebug($"GracePeriod background task is stopping.");
+
}
private void CheckConfirmedGracePeriodOrders()
@@ -54,10 +54,11 @@
var orderIds = GetConfirmedGracePeriodOrders();
+ _logger.LogDebug($"GracePeriod sent a .");
foreach (var orderId in orderIds)
{
- var confirmGracePeriodEvent = new GracePeriodConfirmedIntegrationEvent(orderId);
- _eventBus.Publish(confirmGracePeriodEvent);
+ var gracePeriodConfirmedEvent = new GracePeriodConfirmedIntegrationEvent(orderId);
+ _eventBus.Publish(gracePeriodConfirmedEvent);
}
}
diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/HostedService.cs b/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/HostedService.cs
deleted file mode 100644
index 98ee4907a..000000000
--- a/src/Services/Ordering/Ordering.API/Infrastructure/HostedServices/HostedService.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using Microsoft.Extensions.Hosting;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace Ordering.API.Infrastructure.HostedServices
-{
- public abstract class HostedService : IHostedService
- {
- // Example untested base class code kindly provided by David Fowler: https://gist.github.com/davidfowl/a7dd5064d9dcf35b6eae1a7953d615e3
-
- private Task _executingTask;
- private CancellationTokenSource _cts;
-
- public Task StartAsync(CancellationToken cancellationToken)
- {
- // Create a linked token so we can trigger cancellation outside of this token's cancellation
- _cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
-
- // Store the task we're executing
- _executingTask = ExecuteAsync(_cts.Token);
-
- // If the task is completed then return it, otherwise it's running
- return _executingTask.IsCompleted ? _executingTask : Task.CompletedTask;
- }
-
- public async Task StopAsync(CancellationToken cancellationToken)
- {
- // Stop called without start
- if (_executingTask == null)
- {
- return;
- }
-
- // Signal cancellation to the executing method
- _cts.Cancel();
-
- // Wait until the task completes or the stop token triggers
- await Task.WhenAny(_executingTask, Task.Delay(-1, cancellationToken));
-
- // Throw if cancellation triggered
- cancellationToken.ThrowIfCancellationRequested();
- }
-
- // Derived classes should override this and execute a long running method until
- // cancellation is requested
- protected abstract Task ExecuteAsync(CancellationToken cancellationToken);
- }
-}
diff --git a/test/Services/UnitTest/Ordering/Application/IdentifierCommandHandlerTest.cs b/test/Services/UnitTest/Ordering/Application/IdentifiedCommandHandlerTest.cs
similarity index 94%
rename from test/Services/UnitTest/Ordering/Application/IdentifierCommandHandlerTest.cs
rename to test/Services/UnitTest/Ordering/Application/IdentifiedCommandHandlerTest.cs
index fcddb53a8..1da4db31f 100644
--- a/test/Services/UnitTest/Ordering/Application/IdentifierCommandHandlerTest.cs
+++ b/test/Services/UnitTest/Ordering/Application/IdentifiedCommandHandlerTest.cs
@@ -13,12 +13,12 @@ namespace UnitTest.Ordering.Application
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
- public class IdentifierCommandHandlerTest
+ public class IdentifiedCommandHandlerTest
{
private readonly Mock _requestManager;
private readonly Mock _mediator;
- public IdentifierCommandHandlerTest()
+ public IdentifiedCommandHandlerTest()
{
_requestManager = new Mock();
_mediator = new Mock();
@@ -38,7 +38,7 @@ namespace UnitTest.Ordering.Application
.Returns(Task.FromResult(true));
//Act
- var handler = new IdentifierCommandHandler(_mediator.Object, _requestManager.Object);
+ var handler = new IdentifiedCommandHandler(_mediator.Object, _requestManager.Object);
var result = await handler.Handle(fakeOrderCmd);
//Assert
@@ -60,7 +60,7 @@ namespace UnitTest.Ordering.Application
.Returns(Task.FromResult(true));
//Act
- var handler = new IdentifierCommandHandler(_mediator.Object, _requestManager.Object);
+ var handler = new IdentifiedCommandHandler(_mediator.Object, _requestManager.Object);
var result = await handler.Handle(fakeOrderCmd);
//Assert