Open
Conversation
Owner
There was a problem hiding this comment.
The reason I used DefaultConfiguration instead of a singleton is because SwaggerConfig can be passed to the controller, and in fact, if you use an IoS container like autofac or unity etc, you can have it automatically inject a SwaggerConfig. Also makes unit tests easier; singletons are hard to test.
Author
There was a problem hiding this comment.
Thats why I'm not using the singleton unless the this.SwaggerConfig property in null. Controller property can be marked as dependency property for IoC. (as can swaggerConfiguration.Instance)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Greg, here is a pull request with a couple of examples. I had to revert to '/api/{id}' because I screwed up the routing but I did start to implement the ability to pull a document_controller_alias (swagger_contoller) from web.config.
Also implemented swaggerConfig as singleton and moved logic out of controller in to factory.
Take what you like and leave what you don't. :)
btw - I could really use that model logic to meet a deadline! Can you put it in a gist or something?
thx!