vgquotes/Src/VideoGameQuotes.Web/Global.asax.cs
tmont 9a1f0347c0 * tests for user provider
* username is no longer required
* added ip address property to user
2011-02-10 21:04:13 +00:00

37 lines
1.1 KiB
C#

using System.Web.Mvc;
using System.Web.Routing;
using Microsoft.Practices.Unity;
using Portoa.Web;
using Portoa.Web.Unity;
using VideoGameQuotes.Api;
using VideoGameQuotes.Api.Persistence;
using VideoGameQuotes.Web.Security;
namespace VideoGameQuotes.Web {
public class MvcApplication : ApplicationBase {
protected override void ConfigureUnity() {
Container
.AddNewExtension<ConfigureLog4Net>()
.Configure<ILog4NetConfigurator>()
.SetName("VideoGameQuotes.Web")
.UseXml();
Container
.AddNewExtension<LogAllMethodCalls>()
.RegisterType<ICurrentUserProvider, SessionBasedUserProvider>()
.RegisterType<IUserService, UserService>()
.RegisterType<IUserRepository, UserRepository>();
}
protected override void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("media/{*anything}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}