Beispiel #1
0
        public static void Func_As_Converter()
        {
            var repository = new FakeCustomerRepository();
            var customer = repository.GetCustomers();

            Func<Customer, dynamic> converter = x => new
            {
                CustomerName = x.Name,
                CustomerAddress = x.Address
            };

            dynamic convertedCustomer = converter(customer.First());

            Console.WriteLine(convertedCustomer.CustomerName);
            Console.WriteLine(convertedCustomer.CustomerAddress);
        }
Beispiel #2
0
        public static Customer GetCustomerFromDatabase()
        {
            var repository = new FakeCustomerRepository();

            return repository.GetCustomer(1);
        }
Beispiel #3
0
        public static IList<Customer> GetCustomersFromDatabase()
        {
            var repository = new FakeCustomerRepository();

            return repository.GetCustomers();
        }