public void BuiltInDelegates()
{
//takes a parameter, returns void delegate void Action<T1>(T1 parameter1);
Action<int> action = SomeArbitraryMethod;
//takes 0 or more params and returns the final generic type parameter
Func<string, string> func = FunctionOne;
//returns a bool and accepts the only type parameter
Predicate<string> predicate = SomeCondition;
Action<Order> orderAction = (order) =>
{
order.Total += 10;
};
Func<Order, string> orderFunction = (order) =>
{
decimal total = order.Total;
return String.Format("Order {0} total is {1}", order.OrderId, total);
};
}