I am working on a project with a huge number of data tables and displaying them through ASP.net MVC screens.
I find myself writing a lot of simple data annotations like this:
[Display(Name = "Manager Name")]
public string ManagerName { get; set; }
[Display(Name = "Employee Name")]
public string EmployeeName { get; set; }
[Display(Name = "Employee No")]
public string EmployeeNo { get; set; }
[Display(Name = "Manager Employee No")]
public string ManagerEmployeeNo { get; set; }
This is getting quite tedious and was wondering if there is a way that I can either add a new attribute that says "convertFromCamel" (or something) or is there a way to override
@Html.DisplayNameFor(m => Model.First().EmployeeNo)
So that if there is no data annotation it converts the existing field name from camel case.
thanks in advance