我正在阅读特定类型List<T>
实体的所有属性。
除了Nullable<int>
var properties = entities.GetType().GetGenericArguments().Single()
.GetProperties(BindingFlags.Instance | BindingFlags.Public)
.Where( p => Type.GetTypeCode(p.PropertyType) != TypeCode.Object).ToList();
如何更改查询以获取Nullable<T>
类型?
答案 0 :(得分:1)
public class GetAddressInfoResponse : ApiResponse
{
// ErrorCode supplied from base
// ErrorMessage supplied from base
public AddressInfo AddressInfo { get; set; }
}
将计为Nullable<T>
,因此您需要更改查询:
TypeCode.Object
答案 1 :(得分:0)
<header>