public static CustomerViewModel Create(CustomerDomain customerDomain) { return new CustomerViewModel { Id = customerDomain.Id, Name = customerDomain.Name, Email = customerDomain.Email, Phone = customerDomain.Phone, PIN = customerDomain.PIN }; }
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); }; }
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; }
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; }
private static void Display(CustomerDomain customerDomain) { Console.Write("Product name: {0}", customerDomain.Name); }
public static CustomerViewModel Create(CustomerDomain customerDomain) { return new CustomerViewModel { Id = customerDomain.Id, Name = customerDomain.Name }; }
public static ProductDomain CreateProductDomain(this Product product, CustomerDomain customerDomain = null) { return Create(product, customerDomain); }