标题: C#反射方法扩展 [打印本页] 作者: Adam丶鱼 时间: 2020-3-21 12:53 标题: C#反射方法扩展 using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace LiLi.Util
{
public static class ReflectionExtension
{
public static IEnumerable<string> Keys(this Type type, BindingFlags? propBindingAttr = null, BindingFlags? fieldBindingAttr = null)
{
List<string> result = new List<string>();
result.AddRange(PropertyKeys(type, propBindingAttr));
result.AddRange(FieldKeys(type, fieldBindingAttr));
return result;
}