Beispiel #1
0
        private Order CreateOrder(Record record)
        {
            Guid guid     = Guid.Parse(record["Guid"]);
            var  items    = LoadItems(guid);
            var  address  = _addressRepository.Load(Guid.Parse(record["AddressGuid"]));
            var  newOrder = new Order(guid, int.Parse(record["Id"]), DateTimeOffset.Parse(record["Date"]), items, address, Guid.Parse(record["CustomerGuid"]));

            return(newOrder);
        }
        private List <Address> LoadAddresses(Guid customerGuid)
        {
            var addressGuids = new List <Guid>();

            for (int i = 0; i < _customerToAddressStorage.Length; i++)
            {
                if (Guid.Parse(_customerToAddressStorage[i]["CustomerGuid"]) == customerGuid)
                {
                    addressGuids.Add(Guid.Parse(_customerToAddressStorage[i]["AddressGuid"]));
                }
            }
            return(_addressRepository.Load(addressGuids));
        }