public void Add(IHandleRegistration <T> reg) { if (regs.OfType <IHandleRegistration <T> >().Where(r => r.Operation == reg.Operation).FirstOrDefault() != null) { throw new ObjectPortalOperationNotSupportedException($"Key is already present in registrations {reg.Operation.ToString()}"); } regs.Add(reg); }
public void Add <C, D>(Operation operation, Action <T, C, D> action) { IHandleRegistration <T, C, D> reg = rootContainer.Resolve <Func <Operation, Action <T, C, D>, IHandleRegistration <T, C, D> > >()(operation, action); Add(reg); }