# HG changeset patch # User juanjose.montesdeocaarbos # Date 1328668100 10800 # Node ID 8b0c62c255cd09778239d0dd8a300f152877a0b5 # Parent eeca9ddb330a07fd66f05ead79c88e459bbb0552 Se modifica DataAnnotationAndConventionModelMetadataProvider.cs para que lea Recursos en base al Assembly Fullname diff -r eeca9ddb330a -r 8b0c62c255cd Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs --- a/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs Mon Jan 02 19:44:41 2012 -0300 +++ b/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.Designer.cs Tue Feb 07 23:28:20 2012 -0300 @@ -61,6 +61,24 @@ } /// + /// Looks up a localized string similar to AltNetHispanoAgendasWebModelsPatrocinadorEditModelNombreDescription. + /// + public static string AltNetHispanoAgendasWebModelsPatrocinadorEditModelNombreDescription { + get { + return ResourceManager.GetString("AltNetHispanoAgendasWebModelsPatrocinadorEditModelNombreDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AltNetHispanoAgendasWebModelsPatrocinadorNewModelNombreDescription. + /// + public static string AltNetHispanoAgendasWebModelsPatrocinadorNewModelNombreDescription { + get { + return ResourceManager.GetString("AltNetHispanoAgendasWebModelsPatrocinadorNewModelNombreDescription", resourceCulture); + } + } + + /// /// Looks up a localized string similar to DuraciĆ³n. /// public static string Duracion { diff -r eeca9ddb330a -r 8b0c62c255cd Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx --- a/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx Mon Jan 02 19:44:41 2012 -0300 +++ b/Agendas/trunk/src/Agendas.Resources/Properties/DataAnnotationResources.resx Tue Feb 07 23:28:20 2012 -0300 @@ -117,6 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Nombre del Patrocinador + + + Nombre del Patrocinador + DuraciĆ³n diff -r eeca9ddb330a -r 8b0c62c255cd Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs --- a/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Mon Jan 02 19:44:41 2012 -0300 +++ b/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Tue Feb 07 23:28:20 2012 -0300 @@ -26,10 +26,28 @@ if (propertyName != null) { // Si no hay displayName asignado, lo buscamos entre los recursos + // Primero lo buscarmos por el Assembly FullName y el propertyName + // Si no lo encuentra, buscamos por el propertyName unicamente + if (string.IsNullOrWhiteSpace(modelMetadata.DisplayName)) + { + if (containerType != null && containerType.FullName != null) + modelMetadata.DisplayName = + _resolverByConvention.GetDisplayName(string.Format("{0}{1}", containerType.FullName.Replace(".", string.Empty), + propertyName)); + } if (string.IsNullOrWhiteSpace(modelMetadata.DisplayName)) modelMetadata.DisplayName = _resolverByConvention.GetDisplayName(propertyName); // Si no hay description asignado, lo buscamos entre los recursos + // Primero lo buscarmos por el Assembly FullName y el propertyName + // Si no lo encuentra, buscamos por el propertyName unicamente + if (string.IsNullOrWhiteSpace(modelMetadata.Description)) + { + if (containerType != null && containerType.FullName != null) + modelMetadata.Description = + _resolverByConvention.GetDescription(string.Format("{0}{1}", containerType.FullName.Replace(".", string.Empty), + propertyName)); + } if (string.IsNullOrWhiteSpace(modelMetadata.Description)) modelMetadata.Description = _resolverByConvention.GetDescription(propertyName);