Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reformat default server.fs - use DI #466

Closed
wants to merge 1 commit into from
Closed

Conversation

isaacabraham
Copy link
Member

Keeps the class-based structure, but makes the following changes:

  • Move the initialisation of the in-memory DB into the Storage class.
  • Registration of the service as a singleton into ASP .NET service collection.
  • Retrieval of the service through the Http Context's GetService method.
  • Small formatting changes.

@olivercoad
Copy link
Contributor

I'm guessing you're choosing between these two PRs. I like #465. This one would be great as a recipe for how to use DI.

@isaacabraham
Copy link
Member Author

@olivercoad exactly. And yes, my preference is the other one too :-)

@theimowski
Copy link
Member

not sure which one I prefer TBH :) need to give it some more thoughts

@isaacabraham
Copy link
Member Author

I suggest we close this and convert into a recipe / guide for DI with SAFE Stack.

@isaacabraham
Copy link
Member Author

Closing this - one of us will create a recipe explaining the basics of DI within the context of the server-side SAFE Stack components.

@isaacabraham
Copy link
Member Author

cc: @Ryan-Palmer-CIT @theprash @Akash-Mair

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants