Mercurial > altnet-hispano
diff Agendas/trunk/src/Agendas.Web/Global.asax.cs @ 84:ee4e699e4551
refactoring menor
author | nelopauselli |
---|---|
date | Wed, 25 May 2011 01:18:29 -0300 |
parents | 7e9ffde4022d |
children | 8a4135f019dd |
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Web/Global.asax.cs Tue May 24 21:37:06 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Global.asax.cs Wed May 25 01:18:29 2011 -0300 @@ -3,6 +3,7 @@ using AltNetHispano.Agendas.Domain; using AltNetHispano.Agendas.Factories; using AltNetHispano.Agendas.Resources.Properties; +using AltNetHispano.Agendas.Web.CustomModelMetadataProvider; namespace AltNetHispano.Agendas.Web { @@ -11,13 +12,13 @@ public class MvcApplication : System.Web.HttpApplication { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) + private static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); filters.Add(AttributeFactory.GetNHibernateSessionPerAction()); } - public static void RegisterRoutes(RouteCollection routes) + private static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); @@ -31,7 +32,9 @@ protected void Application_Start() { - ModelMetadataProviders.Current = new ModelMetadataWithDefaultsProvider(new ModelMetadataLocalizable<DataAnnotationResources>()); + ModelMetadataProviders.Current = + new DataAnnotationAndResolveByConventionModelMetadataProvider( + new ResolverThroughResource<DataAnnotationResources>()); AreaRegistration.RegisterAllAreas();