erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Support for ScaffoldColumn Attribute #89

Open davinic opened 11 years ago

davinic commented 11 years ago

Bootstrap default templates ignore ScaffoldColumn() annotations. In my project I've corrected this by updating the VisibleProperties() extension methods with an additional where clause:

.Where(info => info.GetCustomAttribute<System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute>(false)==null || info.GetCustomAttribute<System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute>(false).Scaffold)
serra commented 11 years ago

Good point. The net data annotation [Display(AutoGenerate=false)] is not supported by the bootstrap shared views yet (#83), but should be. I guess [Display(AutoGenerate=false)] should be checked too when generating the template, in addition to the check you mention above.

serra commented 11 years ago

Please note that I have pull request #29 open with significant changes to the templates; consider adding your changes on top of that.