Exemplo n.º 1
0
        public UpdateExistingExchange
            (ExchangeModel exchange
            , ExchangeModelSet exchanges
            , ExchangeData data)
        {
            if (exchange == null)
            {
                throw new ArgumentNullException(nameof(exchange));
            }
            if (exchanges == null)
            {
                throw new ArgumentNullException(nameof(exchanges));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (exchange.Code != data.Code)
            {
                throw new ArgumentException("Data and model's codes do not match");
            }


            this.exchange  = exchange;
            this.exchanges = exchanges;
            this.data      = data;
        }
Exemplo n.º 2
0
        private StateChangeEvent addExchange
            (ExchangeModel exchange)
        {
            if (exchange == null)
            {
                throw new ArgumentNullException(nameof(exchange));
            }


            exchanges.Add(exchange);

            return(new ExchangeAdded());
        }
Exemplo n.º 3
0
            public UpdateRequest
                (ExchangeData data
                , ExchangeModel model)
            {
                if (data == null)
                {
                    throw new ArgumentNullException(nameof(data));
                }
                if (model == null)
                {
                    throw new ArgumentNullException(nameof(model));
                }

                this.data  = data;
                this.model = model;
            }