36 lines
1.0 KiB
C#
36 lines
1.0 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");
|
|
|
|
Container
|
|
.AddNewExtension<LogAllMethodCalls>()
|
|
.RegisterType<ICurrentUserProvider, UserProvider>()
|
|
.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 }
|
|
);
|
|
}
|
|
}
|
|
} |