{"action":"created","issue":{"url":"https://api.github.com/repos/seesharper/LightInject/issues/268","repository_url":"https://api.github.com/repos/seesharper/LightInject","labels_url":"https://api.github.com/repos/seesharper/LightInject/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/seesharper/LightInject/issues/268/comments","events_url":"https://api.github.com/repos/seesharper/LightInject/issues/268/events","html_url":"https://github.com/seesharper/LightInject/issues/268","id":146324770,"number":268,"title":"LightInject.Nancy has to keep the order of registered implementations","user":{"login":"xmedeko","id":1101801,"avatar_url":"https://avatars.githubusercontent.com/u/1101801?v=3","gravatar_id":"","url":"https://api.github.com/users/xmedeko","html_url":"https://github.com/xmedeko","followers_url":"https://api.github.com/users/xmedeko/followers","following_url":"https://api.github.com/users/xmedeko/following{/other_user}","gists_url":"https://api.github.com/users/xmedeko/gists{/gist_id}","starred_url":"https://api.github.com/users/xmedeko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmedeko/subscriptions","organizations_url":"https://api.github.com/users/xmedeko/orgs","repos_url":"https://api.github.com/users/xmedeko/repos","events_url":"https://api.github.com/users/xmedeko/events{/privacy}","received_events_url":"https://api.github.com/users/xmedeko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-06T14:06:20Z","updated_at":"2016-04-07T08:53:22Z","closed_at":null,"body":"Nancy need to keep the order of registered implementation types, see https://github.com/NancyFx/Nancy.Serialization.JsonNet/issues/36 \r\n\r\nAlso see https://github.com/NancyFx/Nancy.Bootstrappers.Autofac/blob/master/src/Nancy.Bootstrappers.Autofac/AutofacNancyBootstrapper.cs and where the `PreserveExistingDefaults()` method is used."},"comment":{"url":"https://api.github.com/repos/seesharper/LightInject/issues/comments/206766439","html_url":"https://github.com/seesharper/LightInject/issues/268#issuecomment-206766439","issue_url":"https://api.github.com/repos/seesharper/LightInject/issues/268","id":206766439,"user":{"login":"khellang","id":582487,"avatar_url":"https://avatars.githubusercontent.com/u/582487?v=3","gravatar_id":"","url":"https://api.github.com/users/khellang","html_url":"https://github.com/khellang","followers_url":"https://api.github.com/users/khellang/followers","following_url":"https://api.github.com/users/khellang/following{/other_user}","gists_url":"https://api.github.com/users/khellang/gists{/gist_id}","starred_url":"https://api.github.com/users/khellang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khellang/subscriptions","organizations_url":"https://api.github.com/users/khellang/orgs","repos_url":"https://api.github.com/users/khellang/repos","events_url":"https://api.github.com/users/khellang/events{/privacy}","received_events_url":"https://api.github.com/users/khellang/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T08:53:22Z","updated_at":"2016-04-07T08:53:22Z","body":"> I got to say that I find it strange that Nancy relies of the ordering of a sequence not controlled by Nancy itself.\r\n\r\nThis isn't something we normally do. It just happened to be the behavior of a method for hard-coding the return value of a module to JSON/XML.\r\n\r\n> What about if the LightInject.Nancy would be moved to Nancy project as Nancy.Bootstrappers.LightInject ? They maintain the support for a few other containers already.\r\n\r\nThis is something we've been trying to get away from for ages. We started the initiative to find external bootstrapper owners (https://github.com/NancyFx/Nancy/issues/1712) a long time ago, but haven't really gotten to the point where we've assigned anyone yet. We could move the bootstrapper, but we wouldn't want to maintain it. We're no LightInject experts (nor are we Unit, Windsor or Ninject experts), so we'd rather see the community own it.\r\n\r\n> Although the adapter(bootstrapper) is pretty simple, there are no tests provided by Nancy that verifies the behavior of the adapter. This should not only be be the case for the ordering of multiple services, but also for all behavior expected from the adapter.\r\n\r\nThis is something that was also started a long time ago, but never came through. You can see the start [here](https://github.com/NancyFx/Nancy/blob/master/test/Nancy.Tests/Unit/Bootstrapper/Base/BootstrapperBaseFixtureBase.cs). Unfortunately, the current bootstrapper design has a few too many assumptions about containers that are very hard to test. We're working on a new bootstrapper design for an upcoming version of Nancy (if you're interested, you can see it at [nancy-bootstrapper-prototype](https://github.com/khellang/nancy-bootstrapper-prototype)). This design will make fewer assumptions about the container and thus make more of them compatible and the bootstrapper implementation easier to implement. Because of this, I don't think you'll see us putting out an extensive test suite for the current design. Hopefully we'll get something going for the new one :smile:"}}