Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed application registration enumerations #947

Merged
merged 1 commit into from

2 participants

@thecodejunkie

Before it ended up pulling the enumerables twice for
each registration.

@thecodejunkie thecodejunkie Fixed application registration enumerations
Before it ended up pulling the enumerables twice for
each registration.
a8f7769
@grumpydev grumpydev merged commit 6d5aa79 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2013
  1. @thecodejunkie

    Fixed application registration enumerations

    thecodejunkie authored
    Before it ended up pulling the enumerables twice for
    each registration.
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 6 deletions.
  1. +15 −6 src/Nancy/Bootstrapper/NancyBootstrapperBase.cs
View
21 src/Nancy/Bootstrapper/NancyBootstrapperBase.cs
@@ -248,19 +248,28 @@ public void Initialise()
foreach (var applicationRegistrationTask in this.GetApplicationRegistrationTasks().ToList())
{
- if (applicationRegistrationTask.TypeRegistrations != null)
+ var applicationTypeRegistrations =
+ applicationRegistrationTask.TypeRegistrations;
+
+ if (applicationTypeRegistrations != null)
{
- this.RegisterTypes(this.ApplicationContainer, applicationRegistrationTask.TypeRegistrations);
+ this.RegisterTypes(this.ApplicationContainer, applicationTypeRegistrations);
}
- if (applicationRegistrationTask.CollectionTypeRegistrations != null)
+ var applicationCollectionRegistrations =
+ applicationRegistrationTask.CollectionTypeRegistrations;
+
+ if (applicationCollectionRegistrations != null)
{
- this.RegisterCollectionTypes(this.ApplicationContainer, applicationRegistrationTask.CollectionTypeRegistrations);
+ this.RegisterCollectionTypes(this.ApplicationContainer, applicationCollectionRegistrations);
}
- if (applicationRegistrationTask.InstanceRegistrations != null)
+ var applicationInstanceRegistrations =
+ applicationRegistrationTask.InstanceRegistrations;
+
+ if (applicationInstanceRegistrations != null)
{
- this.RegisterInstances(this.ApplicationContainer, applicationRegistrationTask.InstanceRegistrations);
+ this.RegisterInstances(this.ApplicationContainer, applicationInstanceRegistrations);
}
}
Something went wrong with that request. Please try again.