public static T Create(VposPaymentSupplier id) { Func <T> constructor = null; if (_dict.TryGetValue(id, out constructor)) { return(constructor()); } throw new ArgumentException("No type registered for this vpos supplier"); }
public static void Register(VposPaymentSupplier id, Func <T> ctor) { _dict.Add(id, ctor); }