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); }
public static Customer GetCustomerFromDatabase() { var repository = new FakeCustomerRepository(); return repository.GetCustomer(1); }
public static IList<Customer> GetCustomersFromDatabase() { var repository = new FakeCustomerRepository(); return repository.GetCustomers(); }