System.Web.Http.Authorize against an ApiController (Web API controller) and System.Web.Mvc.Authorize against a Controller (MVC controller).Thanks to: Badri
Source: http://stackoverflow.com/a/19156530/1931848
System.Web.Http.Authorize against an ApiController (Web API controller) and System.Web.Mvc.Authorize against a Controller (MVC controller).FirstName. I want to expose it's descriptive name as First Name[DisplayName("First Name"), Description("First Name of the Member")]
public string FirstName
{
get { return _firstName; }
set { _firstName = value; }
}
PropertyDescriptorCollection propertiesCol = TypeDescriptor.GetProperties(objectBE);
PropertyDescriptor property;
for (int i = 0; i < propertiesCol.Count; i++)
{
property = TypeDescriptor.GetProperties(objectBE)[i];
/*
// Access the Property Name, Display Name and Description as follows
property.Name // Returns "FirstName"
property.DisplayName // Returns "First Name"
property.Description // Returns "First Name of the Member"
*/
}
* where objectBE is the object instance of BE class.