Currently I'm working on a project where we have a query builder - the user selects what data he wants, what is shown on the final report and a few filters. We are also using Entity Framework (Code First) and we need the name of every string property of some classes. E.g.:
Model Class
public class User { public int Id { get; set; } public string FullName { get; set; } public string FullAddress { get; set; } }
As of now, I'm getting every property name like so:
Property Filter
var propertyList = type.GetProperties() .Where(prop => prop.PropertyType == typeof(string)) .Select(prop => prop.Name).ToList();
And it works nicely for any change we make to the database, but it's not easy to read for the user (especially if you consider we need to keep all the code in English, even tough we'll publish it for people who mostly only speak Portuguese).
What I need is to display "FullName" as "Nome Completo", "FullAddress" as "Endereço Completo", etc, and still be able to get the original name somehow.
One solution I thought of was making a static dictionary and update it as needed; it's easy to process with jQuery (two way dictionary made with a simple object) but it'll be a pain to maintain since the database can get really big.
Are there any better options than static dictionaries?