The Siege Project
- Siege.ServiceLocation Part 1 – Introduction and General Use
- Siege.ServiceLocation Part 2 – Contextual Registration and Resolution
- Siege.ServiceLocation Part 3 – Extending the container with custom use cases
- Siege.ServiceLocation Part 4 – Integrating Siege.ServiceLocation with ASP.NET MVC
- Siege.ServiceLocation Part 5 – A guide to getting started with Siege.ServiceLocation
The Quick Start
I’ve put together a quickstart project. You can look through the files in this project to see how everything is put together. You can get the quick start project here:
Things to look at in this project:
- Global.asax.cs – uses SiegeHttpApplication and shows how to hook up your ServiceLocatorAdapter (the quickstart uses Ninject) and shows where to configure the SiegeContainer.
- ServiceLocatorExtensions.cs – shows how to do registrations with the SiegeContainer, both default and contextual. Also, shows how to do context on a variety of conditions, and shows how to register pre-configured instances with the UserFinder class.
- AccountController – contrived, but shows an example of to work with IContextStore
- The other controllers/services – basic classes that build up how the app works together
This is a purely contrived app that doesn’t really do anything. There are 4 users – Webmaster, AdminUser, TrialUser and PaidUser. For all accounts, the password is pass123. As you login as different users you should see things start happening contextually based on attributes associated with the particular user you are associated with. The different views have text explaining how they work and what to expect.
Hopefully this will give a concrete example of how things work together. As always, if you have questions, feel free to leave a comment and I will respond.
Post Footer automatically generated by Add Post Footer Plugin for wordpress.