Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static Customer GetCustomerFromDatabase()
        {
            var repository = new FakeCustomerRepository();

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

            return repository.GetCustomers();
        }