Get [DisplayName] attribute of a property in strongly-typed way
There are two ways to do this: Models.Test test = new Models.Test(); string DisplayName = test.GetDisplayName(t => t.Name); string DisplayName = Helpers.GetDisplayName<Models.Test>(t => t.Name); The first one works by virtue of writing a generic extension method to any TModel (which is all types). This means it will be available on any object and not just … Read more