I am using WCF service
I have a Data Contract:
[DataContract]
[KnownType(typeof(CustomBranches))]
public class CustomBranches
{
[DataMember]
public int Id { get; set; }
[DataMember]
public string branch_name { get; set; }
[DataMember]
public string address_line_1 { get; set; }
[DataMember]
public string city_name { get; set; }
}
Is it possible that i can find the name of all the DataMembers in this class CustomBranches
Like “ID” , “branch name” etc
Thanks
Seeing as it’s a data-contract you should most likely have all these properties available, but if not the following should list all properties of your type:
replace T with the type, and you’re good to go. Depending on your needs you might want different BindingFlags.