mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-24 01:25:48 +08:00
- 优化 实体类重写属性 new 如果类型与基类不一致,无法使用的问题;
This commit is contained in:
@@ -79,11 +79,10 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (isThrowException) throw e;
|
||||
}
|
||||
|
||||
internal static ConcurrentDictionary<Type, Dictionary<string, PropertyInfo>> dicQueryTypeGetProperties = new ConcurrentDictionary<Type, Dictionary<string, PropertyInfo>>();
|
||||
internal Dictionary<string, PropertyInfo> GetQueryTypeProperties(Type type)
|
||||
{
|
||||
var tb = _util.GetTableByEntity(type);
|
||||
var props = tb?.Properties ?? dicQueryTypeGetProperties.GetOrAdd(type, k => type.GetProperties().ToDictionary(a => a.Name, a => a, StringComparer.CurrentCultureIgnoreCase));
|
||||
var props = tb?.Properties ?? type.GetPropertiesDictIgnoreCase();
|
||||
return props;
|
||||
}
|
||||
public List<T> Query<T>(string cmdText, object parms = null) => Query<T>(null, null, CommandType.Text, cmdText, GetDbParamtersByObject(cmdText, parms));
|
||||
|
||||
Reference in New Issue
Block a user