# HG changeset patch # User Nelo@Guinea.neluz.int # Date 1312340509 10800 # Node ID c57ca21064f23c71e76345a341fee26671162a88 # Parent c03c4920228062b32102b6b3cd4fb7ccff5cccb9 Auto UIHint por el nombre de la propiedad, hay un TODO para mejorarlo diff -r c03c49202280 -r c57ca21064f2 Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs --- a/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Tue Aug 02 23:25:25 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/CustomModelMetadataProvider/DataAnnotationAndConventionModelMetadataProvider.cs Wed Aug 03 00:01:49 2011 -0300 @@ -30,6 +30,11 @@ if (string.IsNullOrWhiteSpace(modelMetadata.Description)) modelMetadata.Description = _resolverByConvention.GetDescription(propertyName); + // Auto UIHint por property name. + // TODO: Sería ideal chequear si existe el template antes de asignarlo, ¿cómo? + if (string.IsNullOrWhiteSpace(modelMetadata.TemplateHint)) + modelMetadata.TemplateHint = propertyName; + var validators = _attributeList.OfType(); foreach (var validator in validators) { diff -r c03c49202280 -r c57ca21064f2 Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs --- a/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Tue Aug 02 23:25:25 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/EventoModel.cs Wed Aug 03 00:01:49 2011 -0300 @@ -14,14 +14,12 @@ public class EventoNewModel { [Required] - [UIHint("TipoEvento")] public int TipoEvento { get; set; } [Required] public string Titulo { get; set; } [Required] - [UIHint("Ponente")] public Guid Ponente { get; set; } [Required] @@ -40,7 +38,6 @@ public string Titulo { get; set; } [Required] - [UIHint("Ponente")] public Guid Ponente { get; set; } [Required] @@ -59,7 +56,6 @@ public string Titulo { get; set; } [Required] - [UIHint("Ponente")] public Guid Ponente { get; set; } [Required] diff -r c03c49202280 -r c57ca21064f2 Agendas/trunk/src/Agendas.Web/Models/PropuestaModel.cs --- a/Agendas/trunk/src/Agendas.Web/Models/PropuestaModel.cs Tue Aug 02 23:25:25 2011 -0300 +++ b/Agendas/trunk/src/Agendas.Web/Models/PropuestaModel.cs Wed Aug 03 00:01:49 2011 -0300 @@ -9,13 +9,11 @@ public class PropuestaNewModel { [Required] - [UIHint("TipoEvento")] public int TipoEvento { get; set; } [Required] public string Titulo { get; set; } - [UIHint("Ponente")] public Guid Ponente { get; set; } [Url]