The Siege Project: Siege.ServiceLocation Part 5 – A guide to getting started with Siege.ServiceLocation

The Siege Project

 

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:

http://cloud.github.com/downloads/MarcusTheBold/Siege/SiegeMVCQuickStart.zip

 

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.

 

Happy coding!

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

This entry was posted in IoC, MVC, Siege. Bookmark the permalink. Follow any comments here with the RSS feed for this post.