Esempio n. 1
0
        private static string MapModelToJson(Registration model)
        {
            var registration = new Contracts.Customer.Registration
            {
                Id             = Guid.NewGuid(),
                Timestamp      = DateTime.UtcNow,
                Name           = model.Name,
                FirstName      = model.FirstName,
                Title          = model.Title,
                Birthday       = model.Birthday,
                Email          = model.Email,
                BillingAddress = new Contracts.Common.Address
                {
                    Street  = model.BillingAddressStreet,
                    Number  = model.BillingAddressNumber,
                    City    = model.BillingAddressCity,
                    ZipCode = model.BillingAddressZipCode,
                    Country = model.BillingAddressCountry
                },
                DeliveryAddress = new Contracts.Common.Address
                {
                    Street  = model.DeliveryAddressStreet,
                    Number  = model.DeliveryAddressNumber,
                    City    = model.DeliveryAddressCity,
                    ZipCode = model.DeliveryAddressZipCode,
                    Country = model.DeliveryAddressCountry
                }
            };

            return(JsonConvert.SerializeObject(registration, Formatting.Indented));
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Contracts.Customer.Registration msg = new Contracts.Customer.Registration();
            var repo = new CustomerRepository();

            Processes.Customer.Registration processes = new Processes.Customer.Registration(repo);
            var req = new ProcessRequest {
                Message = msg
            };
        }