/// <summary> /// Adds a collection of registrations to the container. /// </summary> /// <param name="container">Container.</param> /// <param name="registrations">Registrations.</param> public static void AddRegistrations(this IReceivesRegistrations container, IEnumerable <Action <IRegistrationHelper> > registrations) { if (container == null) { throw new ArgumentNullException(nameof(container)); } var registrationsToAdd = registrations ?? Enumerable.Empty <Action <IRegistrationHelper> >(); container.AddRegistrations(helper => { foreach (var registrationAction in registrationsToAdd) { registrationAction(helper); } }); }
void AddRootContainerRegistrations(IReceivesRegistrations container) { container.AddRegistrations(builder.ServiceRegistrations.PerTestRun); }