From bcc158a96de4818c05b9e43c238f7f0922639fee Mon Sep 17 00:00:00 2001 From: Dmytro Hridin Date: Sun, 5 May 2019 15:22:11 +0300 Subject: [PATCH] move BasketRepository to from Models folder to Repositories folders --- .../Basket/Basket.API/Controllers/BasketController.cs | 2 +- .../Repositories}/IBasketRepository.cs | 5 +++-- .../Repositories}/RedisBasketRepository.cs | 5 +++-- .../EventHandling/OrderStartedIntegrationEventHandler.cs | 2 +- .../ProductPriceChangedIntegrationEventHandler.cs | 1 + src/Services/Basket/Basket.API/Startup.cs | 1 + .../Basket.FunctionalTests/RedisBasketRepositoryTests.cs | 1 + .../Basket/Basket.UnitTests/Application/BasketWebApiTest.cs | 1 + 8 files changed, 12 insertions(+), 6 deletions(-) rename src/Services/Basket/Basket.API/{Model => Infrastructure/Repositories}/IBasketRepository.cs (62%) rename src/Services/Basket/Basket.API/{Model => Infrastructure/Repositories}/RedisBasketRepository.cs (91%) diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index 69f601579..e4abe3a92 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -3,10 +3,10 @@ using Basket.API.Model; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.eShopOnContainers.Services.Basket.API.Services; using Microsoft.Extensions.Logging; -using Serilog.Context; using System; using System.Net; using System.Threading.Tasks; diff --git a/src/Services/Basket/Basket.API/Model/IBasketRepository.cs b/src/Services/Basket/Basket.API/Infrastructure/Repositories/IBasketRepository.cs similarity index 62% rename from src/Services/Basket/Basket.API/Model/IBasketRepository.cs rename to src/Services/Basket/Basket.API/Infrastructure/Repositories/IBasketRepository.cs index 850b5b637..0aac7baee 100644 --- a/src/Services/Basket/Basket.API/Model/IBasketRepository.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Repositories/IBasketRepository.cs @@ -1,7 +1,8 @@ -using System.Collections.Generic; +using Microsoft.eShopOnContainers.Services.Basket.API.Model; +using System.Collections.Generic; using System.Threading.Tasks; -namespace Microsoft.eShopOnContainers.Services.Basket.API.Model +namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories { public interface IBasketRepository { diff --git a/src/Services/Basket/Basket.API/Model/RedisBasketRepository.cs b/src/Services/Basket/Basket.API/Infrastructure/Repositories/RedisBasketRepository.cs similarity index 91% rename from src/Services/Basket/Basket.API/Model/RedisBasketRepository.cs rename to src/Services/Basket/Basket.API/Infrastructure/Repositories/RedisBasketRepository.cs index 5000e6c29..6653f5ed1 100644 --- a/src/Services/Basket/Basket.API/Model/RedisBasketRepository.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Repositories/RedisBasketRepository.cs @@ -1,11 +1,12 @@ -using Microsoft.Extensions.Logging; +using Microsoft.eShopOnContainers.Services.Basket.API.Model; +using Microsoft.Extensions.Logging; using Newtonsoft.Json; using StackExchange.Redis; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace Microsoft.eShopOnContainers.Services.Basket.API.Model +namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories { public class RedisBasketRepository : IBasketRepository { diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs index cb7b6a2d6..2cce760d9 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs @@ -1,7 +1,7 @@ using Basket.API.IntegrationEvents.Events; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.Services.Basket.API; -using Microsoft.eShopOnContainers.Services.Basket.API.Model; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.Extensions.Logging; using Serilog.Context; using System; diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs index c27200e6f..49714c03e 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs @@ -1,4 +1,5 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.Extensions.Logging; diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 97ede1879..9cfabf20a 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -19,6 +19,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling; using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events; using Microsoft.eShopOnContainers.Services.Basket.API.Model; diff --git a/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs b/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs index 84d41aa1a..667c0b008 100644 --- a/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs +++ b/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs @@ -1,5 +1,6 @@ using Basket.FunctionalTests.Base; using Microsoft.eShopOnContainers.Services.Basket.API; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs b/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs index 2864b8b9f..7420ec16b 100644 --- a/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs +++ b/src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.Services.Basket.API.Controllers; +using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.Extensions.Logging; using Moq;