Browse Source

Fixing a nullreference exception

Also util files to start only "external containers"
pull/49/merge vs2015
etomas 8 years ago
parent
commit
7521e7434d
4 changed files with 40 additions and 4 deletions
  1. +17
    -0
      docker-compose-external.override.yml
  2. +16
    -0
      docker-compose-external.yml
  3. +6
    -4
      src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs
  4. +1
    -0
      start-external.ps1

+ 17
- 0
docker-compose-external.override.yml View File

@ -0,0 +1,17 @@
#
# docker-compose.override.yml is used to set up local configuration environment
# Things like the external ports to use or secrets/passwords depend on the
# specific deployment environment you might be using.
# Further details and docs: https://docs.docker.com/compose/extends/
#
version: '2'
services:
sql.data:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433"

+ 16
- 0
docker-compose-external.yml View File

@ -0,0 +1,16 @@
#
# docker-compose.yml is used to set up the base config per container to be deployed
# Take into account that when deploying, this base configuration is merged with the
# configuration-per-environment specified at the docker-compose.override.yml
# Further details and docs: https://docs.docker.com/compose/extends/
#
version: '2'
services:
sql.data:
image: microsoft/mssql-server-linux
basket.data:
image: redis
ports:
- "6379:6379"

+ 6
- 4
src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs View File

@ -1,5 +1,6 @@
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@ -12,11 +13,13 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
private List<PaymentMethod> _paymentMethods;
public IEnumerable<PaymentMethod> PaymentMethods => _paymentMethods?.AsReadOnly();
public IEnumerable<PaymentMethod> PaymentMethods => _paymentMethods.AsReadOnly();
protected Buyer() { }
protected Buyer() {
_paymentMethods = new List<PaymentMethod>();
}
public Buyer(string identity)
public Buyer(string identity) : this()
{
if (String.IsNullOrWhiteSpace(identity))
{
@ -25,7 +28,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
IdentityGuid = identity;
_paymentMethods = new List<PaymentMethod>();
}
public PaymentMethod AddPaymentMethod(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration)


+ 1
- 0
start-external.ps1 View File

@ -0,0 +1 @@
docker-compose -f docker-compose-external.yml -f docker-compose-external.override.yml up

Loading…
Cancel
Save