I have a class of name MyClass Which has many properties
class MyClass
{
public int Id { get; set; }
public string Name { get; set; }
public string email { get; set; }
public string password { get; set; }
public string city { get; set; }
}
I want to print the properties name in Console.writeline like
static void Main(string[] args)
{
MyClass m = new MyClass();
var s = m.GetType()
.GetFields();
Console.WriteLine(s);
Console.ReadKey();
}
but it give me every time
System.Reflection.FieldInfo[]
Kindly tell me how can i do this or i can do this or not