Exemple #1
0
        public Customer FindBy(Guid id)
        {
            Customer customer = new CustomerProxy();

            // Code to connect to the database and retrieve a customer

            ((CustomerProxy)customer).OrderRepository = _orderRepository;

            return(customer);
        }
        public Customer FindBy(Guid id)
        {
            Customer customer = new CustomerProxy();

            // Code to connect to the database and retrieve a customer

            ((CustomerProxy)customer).OrderRepository = _orderRepository;

            return customer;
        }
        static void Main(string[] args)
        {
            Guid customerId = Guid.NewGuid();

            IOrderRepository orderRepository = new OrderRepository();

            Customer customer = new CustomerProxy() { OrderRepository = orderRepository, Id = customerId };

            IEnumerable<Order> orders = customer.Orders;
        }