Example:
public class BusinessTransactionFactory where T : IBusinessTransaction
{
readonly Func _createTransactio
@Steven's answer is very well thought out; personally I find limited use of Func
arguments readable.
What I don't understand is the value of BusinessTransactionFactory
and IBusinessTransactionFactory
. These are just wrappers around the delegate. Presumably you're injecting IBusinessTransactionFactory
somewhere else. Why not just inject the delegate there?
I think of Func
(and Func
, etc.) as factories. To me you have a factory class implementing a factory interface wrapping a factory delegate, and that seems redundant.