Fixing a nullreference exception

Also util files to start only "external containers"
This commit is contained in:
etomas 2017-02-14 16:17:30 +01:00
parent decb87e0c6
commit 7521e7434d
4 changed files with 40 additions and 4 deletions

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"

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"

View File

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

1
start-external.ps1 Normal file
View File

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