Skip to content

Commit b416203

Browse files
committed
Merge branch 'vs2017' of https://github.com/dotnet/eShopOnContainers into vs2017
2 parents e66b6a2 + bfe2139 commit b416203

15 files changed

Lines changed: 32 additions & 31 deletions

File tree

src/Services/Basket/Basket.API/Controllers/BasketController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
1010
{
1111
//TODO NOTE: Right now this is a very chunky API, as the app evolves it is possible we would
12-
//want to make the actions more fine graned, add basket item as an action for example.
12+
//want to make the actions more fine grained, add basket item as an action for example.
1313
//If this is the case we should also investigate changing the serialization format used for Redis,
1414
//using a HashSet instead of a simple string.
1515
[Route("/")]

src/Services/Basket/Basket.API/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ Sample reference containerized application, cross-platform and microservices arc
33
Powered by Microsoft
44

55
#Overview
6-
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution.
6+
This sample runs a microservices oriented application and an ASP.NET Core MVC application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution.
77

88
#Deploy
9-
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure.
9+
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infrastructure.
1010

11-
- <a href='build-image-services-basket.ps1'>build-image-services-basket.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications.
11+
- <a href='build-image-services-basket.ps1'>build-image-services-basket.ps1</a> <b>Build .net applications and docker images</b>: This PowerShell script that you will find in the <u>root directory of the solution</u> is responsible for building .NET applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .NET applications.
1212

13-
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up`
13+
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favorite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up`
1414

1515
#Run
16-
Once the deploy process of docker-compose finishes you have to be able to access the services in this urls:
16+
Once the deploy process of docker-compose finishes you have to be able to access the services in these urls:
1717
- Basket service: http://localhost:5103
1818
- Identity service: http://localhost:5105
1919
- Basket data (Redis): listening in localhost:6379

src/Services/Basket/Basket.API/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public void ConfigureServices(IServiceCollection services)
3737
services.AddMvc();
3838
services.Configure<BasketSettings>(Configuration);
3939

40-
//By connection here we are making sure that our service
40+
//By connecting here we are making sure that our service
4141
//cannot start until redis is ready. This might slow down startup,
42-
//but given that it is there is a delay on resolving the ip address
42+
//but given that there is a delay on resolving the ip address
4343
//and then creating the connection it seems reasonable to move
4444
//that cost to startup instead of having the first request pay the
4545
//penalty.

src/Services/Catalog/Catalog.API/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Sample reference containerized application, cross-platform and microservices arc
33
Powered by Microsoft
44

55
#Overview
6-
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution.
6+
This sample runs a microservices oriented application and an ASP.NET Core MVC application that consumes these services. You can find more information about how to set up docker in your machine in the global directory solution.
77

88
#Deploy
9-
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infraestructure.
9+
In the global directory you will find the scripts needed to run and deploy the demo into your local docker infrastructure.
1010

11-
- <a href='build-image-services-catalog.ps1'>build-image-services-catalog.ps1</a> <b>Build .net applications and docker images</b>: This power shell script that you will find in the <u>root directory of the solution</u> is the responsible of building .net applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .net applications.
11+
- <a href='build-image-services-catalog.ps1'>build-image-services-catalog.ps1</a> <b>Build .net applications and docker images</b>: This PowerShell script that you will find in the <u>root directory of the solution</u> is responsible for building .NET applications and package in a pub folder and use docker commands to build the images needed to run the previously packaged .NET applications.
1212

1313
- <b>Compose containers in your docker local VM</b>: Finally you have to open your favourite command tool pointing to the <u>root directory of this project</u> where docker-compose.yml file is located and run the command `docker-compose up`
1414

src/Services/Catalog/Catalog.API/settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace Microsoft.eShopOnContainers.Services.Catalog.API
77
{
8+
// TODO: Rename CatalogSettings for consistency?
89
public class Settings
910
{
1011
public string ExternalCatalogBaseUrl {get;set;}

src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
public class CreateOrderCommandHandler
1010
: IAsyncRequestHandler<CreateOrderCommand, bool>
1111
{
12-
private readonly IBuyerRepository _buyerRepository;
13-
private readonly IOrderRepository _orderRepository;
12+
private readonly IBuyerRepository<Buyer> _buyerRepository;
13+
private readonly IOrderRepository<Order> _orderRepository;
1414

1515
// Using DI to inject infrastructure persistence Repositories
16-
public CreateOrderCommandHandler(IBuyerRepository buyerRepository, IOrderRepository orderRepository)
16+
public CreateOrderCommandHandler(IBuyerRepository<Buyer> buyerRepository, IOrderRepository<Order> orderRepository)
1717
{
1818
_buyerRepository = buyerRepository ?? throw new ArgumentNullException(nameof(buyerRepository));
1919
_orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository));

src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ protected override void Load(ContainerBuilder builder)
2727
.InstancePerLifetimeScope();
2828

2929
builder.RegisterType<BuyerRepository>()
30-
.As<IBuyerRepository>()
30+
.As<IBuyerRepository<Buyer>>()
3131
.InstancePerLifetimeScope();
3232

3333
builder.RegisterType<OrderRepository>()
34-
.As<IOrderRepository>()
34+
.As<IOrderRepository<Order>>()
3535
.InstancePerLifetimeScope();
3636
}
3737
}

src/Services/Ordering/Ordering.API/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
4545
services.AddMvc(options =>
4646
{
4747
options.Filters.Add(typeof(HttpGlobalExceptionFilter));
48-
}).AddControllersAsServices(); //Controllers are also injected thru DI
48+
}).AddControllersAsServices(); //Injecting Controllers themselves thru DI
49+
//For further info see: http://docs.autofac.org/en/latest/integration/aspnetcore.html#controllers-as-services
4950

5051
services.AddEntityFrameworkSqlServer()
5152
.AddDbContext<OrderingContext>(options =>

src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/IBuyerRepository.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
2-
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
32
using System.Threading.Tasks;
43

54
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
65
{
76
//This is just the RepositoryContracts or Interface defined at the Domain Layer
87
//as requisite for the Buyer Aggregate
9-
public interface IBuyerRepository
10-
:IAggregateRepository
8+
9+
public interface IBuyerRepository<T> : IRepository<T> where T : IAggregateRoot
1110
{
1211
Buyer Add(Buyer buyer);
1312

src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
22

33
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
4-
{
4+
{
55
//This is just the RepositoryContracts or Interface defined at the Domain Layer
66
//as requisite for the Order Aggregate
7-
public interface IOrderRepository
8-
:IAggregateRepository
7+
8+
public interface IOrderRepository<T> : IRepository<T> where T : IAggregateRoot
99
{
1010
Order Add(Order order);
1111
}

0 commit comments

Comments
 (0)