Get attribute and value from generic class
How do I get attribute name and it's value using IReadOnlyMappingManager ?
I create variable with :
mappingManager = ServiceLocator.Current.GetInstance<IReadOnlyMappingManager>();
An i use
mappingManager.GetFields(typeof(T))
开发者_如何学Python
But I haven't keys and value for fiels.
Thanks
It's a little unclear, but maybe something like this is what you want?
var props = typeof(IReadOnlyMappingManager).GetProperties();
foreach (var p in props)
var value = p.GetValue(mappingManager)
精彩评论