I am new to entity framework.
I want to get the number of columns of an entity object just like the old Datatable technique. İs it possible ?
For example ,开发者_JS百科 in standart Nortwind Database , For the Customers table how can I get number of columns from Customers class derived from EntityObject;
Thanks in advance.
I think you can do this using reflection
PropertyInfo[] propertyInfos;
propertyInfos = typeof(MyClass).GetProperties();
var numberCol = propertyInfos.Length;
instead MyClass you should use your entity class
You can find it by exploring the MetadataWorkspace
http://msdn.microsoft.com/en-us/library/bb387116.aspx
精彩评论