方法:
public static string GetPropertyName(Expression<Func<SupplierInfos, string>> expr)
{
var name = ((MemberExpression)expr.Body).Member.Name;
return name;
}
调用:
string SI_State = GetPropertyName(t => t.SI_State);
2022-11-29 15:26:09
方法:
public static string GetPropertyName(Expression<Func<SupplierInfos, string>> expr)
{
var name = ((MemberExpression)expr.Body).Member.Name;
return name;
}
调用:
string SI_State = GetPropertyName(t => t.SI_State);