C# int类型的GetProperty的PropertyType返回的是Int32,无法通过typeof(int)或者typeof(Int32)进行比较

最近在试着写IOrderedQueryable的扩展排序方法

在获取排序字段是int型时,返回的是Int32,无法与typeof(int)匹配到

然后查了下用TypeCode去比就没问题

原文地址:https://www.cnblogs.com/pashanhu/p/9662300.html