Hi i'm working in a class library using C#, and i have some classes with some properties.
I just wanna know if i can add something to exclude some properties form the getType().GetProperties().
An example of what i want:
class Test
{
public string one { get; set; } public string two {get ; set;}
}
and if i do this:
static void Main(string[] args)
{
Test t = new Test(); Type ty = t.GetType(); PropertyInfo[] pinfo = ty.GetProperties(); foreach (PropertyInfo p in pinfo) { Console.WriteLine(p.Name); }
}
i want the output be something like this:
one
or just one of the properties.
Is possible to do something like that? i don't know if there some kind of modifiers or annotations in C#, that allow me to do what i want.
Thanks.