2011-02-10 04:39:59 +00:00
|
|
|
|
using System.Web.Mvc;
|
2011-02-09 03:50:45 +00:00
|
|
|
|
using System.Web.Routing;
|
2011-02-10 04:39:59 +00:00
|
|
|
|
using Microsoft.Practices.Unity;
|
|
|
|
|
using Portoa.Web;
|
|
|
|
|
using Portoa.Web.Unity;
|
|
|
|
|
using VideoGameQuotes.Api;
|
|
|
|
|
using VideoGameQuotes.Api.Persistence;
|
|
|
|
|
using VideoGameQuotes.Web.Security;
|
2011-02-09 03:50:45 +00:00
|
|
|
|
|
|
|
|
|
namespace VideoGameQuotes.Web {
|
2011-02-10 04:39:59 +00:00
|
|
|
|
public class MvcApplication : ApplicationBase {
|
|
|
|
|
protected override void ConfigureUnity() {
|
|
|
|
|
Container
|
|
|
|
|
.AddNewExtension<ConfigureLog4Net>()
|
|
|
|
|
.Configure<ILog4NetConfigurator>()
|
2011-02-10 20:34:55 +00:00
|
|
|
|
.SetName("VideoGameQuotes.Web")
|
|
|
|
|
.UseXml();
|
2011-02-10 04:39:59 +00:00
|
|
|
|
|
|
|
|
|
Container
|
|
|
|
|
.AddNewExtension<LogAllMethodCalls>()
|
2011-02-10 21:04:13 +00:00
|
|
|
|
.RegisterType<ICurrentUserProvider, SessionBasedUserProvider>()
|
2011-02-10 04:39:59 +00:00
|
|
|
|
.RegisterType<IUserService, UserService>()
|
|
|
|
|
.RegisterType<IUserRepository, UserRepository>();
|
|
|
|
|
}
|
2011-02-09 03:50:45 +00:00
|
|
|
|
|
2011-02-10 04:39:59 +00:00
|
|
|
|
protected override void RegisterRoutes(RouteCollection routes) {
|
2011-02-09 03:50:45 +00:00
|
|
|
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
2011-02-10 04:39:59 +00:00
|
|
|
|
routes.IgnoreRoute("media/{*anything}");
|
2011-02-09 03:50:45 +00:00
|
|
|
|
|
2011-02-11 05:21:31 +00:00
|
|
|
|
routes.MapRoute("about", "about", new { controller = "Home", action = "About" });
|
|
|
|
|
routes.MapRoute("contact", "contact", new { controller = "Home", action = "Contact" });
|
|
|
|
|
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
|
2011-02-09 03:50:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|