开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜