コード例 #1
0
 public static CustomerViewModel Create(CustomerDomain customerDomain)
 {
     return new CustomerViewModel
     {
         Id = customerDomain.Id,
         Name = customerDomain.Name,
         Email = customerDomain.Email,
         Phone = customerDomain.Phone,
         PIN = customerDomain.PIN
     };
 }
コード例 #2
0
 public static Customer Create(CustomerDomain customerDomain)
 {
     return new Customer
     {
         Id = customerDomain.Id,
         Name = customerDomain.Name,
         Email = customerDomain.Email,
         Phone = customerDomain.Phone,
         PIN = customerDomain.PIN
         //Products = customerDomain.Products.GetAll().Select(ProductFactory.Create);
     };
 }
コード例 #3
0
 public static ProductDomain Create(Product product, CustomerDomain customerDomain)
 {
     ProductDomain productDomain = new ProductDomain
     {
     Id = product.Id,
     Name = product.Name,
     ReleaseDate = product.ReleaseDate,
     Type = product.Type,
     CustomerId = product.CustomerId
     };
     if (customerDomain != null)
     {
     productDomain.Customer = customerDomain;
     }
     else
     {
     productDomain.Customer = product.Customer == null ? null : product.Customer.CreateCustomerDomain();
     }
     return productDomain;
 }
コード例 #4
0
        public static CustomerDomain Create(Customer customer)
        {
            CustomerDomain customerDomain = new CustomerDomain
            {
                Id = customer.Id,
                Name = customer.Name,
                Email = customer.Email,
                Phone = customer.Phone,
                PIN = customer.PIN
            };

            if (customer.Products != null && customer.Products.Any())
            {
                var productList = new List<ProductDomain>();
                foreach (var product in customer.Products)
                {
                    productList.Add(product.CreateProductDomain(customerDomain));
                }
                customerDomain.Products = productList;
            }
            return customerDomain;
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: komsky/training
 private static void Display(CustomerDomain customerDomain)
 {
     Console.Write("Product name: {0}", customerDomain.Name);
 }
コード例 #6
0
 public static CustomerViewModel Create(CustomerDomain customerDomain)
 {
     return new CustomerViewModel { Id = customerDomain.Id, Name = customerDomain.Name };
 }
コード例 #7
0
 public static ProductDomain CreateProductDomain(this Product product, CustomerDomain customerDomain = null)
 {
     return Create(product, customerDomain);
 }