SimpleInjector icon indicating copy to clipboard operation
SimpleInjector copied to clipboard

Is there any sample code

Open stevensrf1 opened this issue 10 years ago • 4 comments

Is there any sample code that is complete and focus on every issue like there is for Unity Bootstrapper? Seem like all there is the documentation which just shows one or two line snippets, For example any code showing examples of the Singletons that are not disposed of when registered in the container. or example of action filter attributes use so they are no stored as as singleton in web api?

stevensrf1 avatar Sep 01 '16 04:09 stevensrf1

Writing good and comprehensive documentation is a major undertaking. Although Unity's features where always lacking behind, the Patterns & Practices team did absolutely one thing right: documentation. The amount of documentation Unity has is unpaired by any OSS DI library.

That said, the Simple Injector Contributors do their best in improving the documentation regularly. Do you have any concrete suggestions on where we might improve the documentation? Can you elaborate what you mean with "focus on every issue"? Do you have an example of the Unity docs for this?

If you have any specific questions on disposing Singletons, you can create a new issue/question here.

dotnetjunkie avatar Sep 01 '16 05:09 dotnetjunkie

or example of action filter attributes use so they are no stored as as singleton in web api

Take a look at this Stackoverflow answer for more information.

dotnetjunkie avatar Sep 01 '16 07:09 dotnetjunkie

Lets see I asked for examples of source code like Unity provides with complete understandable explanations where you can follow along with the code while reading the pdf document. And I get replies one telling me to spend hours and hours searching stack over flow issues on problems people are having hoping to fins what I am looking for, and another reply who want to bash Unity. Can not any one ready what is asked in a question and just respond if there such demo source code out there. I am so sick and tired of reading people who respond to question who never read the question . THere is plenty of example source code for Unity BootStrapper and documentation. Just Google. https://github.com/DonTomato/MelSamples/tree/master/DIwithUnitySample DependencyInjectionWithUnity.pdf and so on

stevensrf1 avatar Sep 01 '16 12:09 stevensrf1

@stevensrf1 Did you have already looked at the following documentation:

Quickstart and then jump to A Quick Example https://simpleinjector.org/quickstart

chfn avatar Sep 01 '16 14:09 chfn