I am using T4Scaffolding, and tried to create a custom Scaffold template. It's not asp.net project, not MVC.
My user class :
public class User
{
public int Id {get;set;}
public string Name {get; set;}
}
in the .cs.t4 file , I need to get the user properties ,I tried to use:
var propertyInfos = typeof(Model.).GetProperties(BindingFlags.Public |
BindingFlags.Static);
foreach (PropertyInfo propertyInfo in propertyInfos)
...
but It did not work, I know in asp.net mvc I can use
foreach (ModelProperty property in GetModelProperties(Model.ViewDataType, false))
What's the correct method in asp.net ???
Thanks for any comment ...