i am new to c#. coming from mainly PHP background or basic VB.
i understand that IEnumerable<Customer> is something like a list of customer.
but what is Action<IEnumerable<Customer>, Exception>. an action of type IEnumerable<Customer> & Exception. doesnt seem to make too much sense to me.
In C#,
ActionandFuncare function pointers, you can pass them around just like any other object and you invoke them in exactly the same way that you call other functions. EssentiallyAction<IEnumerable<Customer>, Exception>means:IEnumerable<Customer>andExceptionas an input.This would be a compatible signature:
Sometimes long generic signatures like the one you have can be cumbersome to work with, it can occasionally be nicer to move those params into a single object such as:
At least then you can pass around an
Action<CustomerContext>, which can save some typing and sanity 🙂