I have the following property class
public class UserModel{
public string Name {get;set;}
[DisplayName="Document Name"]
public string DocumentName {get;set;}
[DisplayName="Terms Usage"]
public string TermsUsage {get;set;}
}
i then call this method when i am assigning values to it as
var item=new List<UserModel>();
foreach(var i in records)
{
//some code happens
item.Add(new UserModel
{
Name = i.FirstName,
DocumentName = i.DocumentName, //i would like to return the item with the display name
TermsUsage = i.TermsUsage
});
}
return item;
so when the item is returned it still has the userModel "DocumentName" and "TermsUsage" how can i get the display name to be returned when returning the item as "Document Name" and "Terms Usage" so that i could make use of them in other parts of code?