## v0.5.3

- 增加 ISelect.ToList(true) 自动贪婪加载 LeftJoin/InnerJoin/RightJoin 导航数据;#35
- 增加 IAdo.Query<T1, T2 ...> 多结果集查询;
- 增加 IAdo.ExecuteDataSet 多结果集查询;
- 优化 未设置实体属性 set 的将被自动过滤 IsIgnore;
This commit is contained in:
28810
2019-04-22 18:34:05 +08:00
parent 58e8771a15
commit 9dd85f33f9
23 changed files with 169 additions and 94 deletions

View File

@@ -48,13 +48,14 @@ namespace FreeSql.Internal {
var propsLazy = new List<(PropertyInfo, bool, bool)>();
var propsNavObjs = new List<PropertyInfo>();
foreach (var p in trytb.Properties.Values) {
var setMethod = trytb.Type.GetMethod($"set_{p.Name}");
var tp = common.CodeFirst.GetDbInfo(p.PropertyType);
//if (tp == null) continue;
var colattr = common.GetEntityColumnAttribute(entity, p);
if (tp == null && colattr == null) {
if (common.CodeFirst.IsLazyLoading) {
var getIsVirtual = trytb.Type.GetMethod($"get_{p.Name}")?.IsVirtual;
var setIsVirtual = trytb.Type.GetMethod($"set_{p.Name}")?.IsVirtual;
var setIsVirtual = setMethod?.IsVirtual;
if (getIsVirtual == true || setIsVirtual == true)
propsLazy.Add((p, getIsVirtual == true, setIsVirtual == true));
}
@@ -96,6 +97,7 @@ namespace FreeSql.Internal {
colattr.DbDefautValue = Activator.CreateInstance(p.PropertyType.IsNullableType() ? p.PropertyType.GenericTypeArguments.FirstOrDefault() : p.PropertyType);
if (colattr.IsIdentity == true && p.PropertyType.IsNumberType() == false)
colattr.IsIdentity = false;
if (setMethod == null) colattr.IsIgnore = true;
var col = new ColumnInfo {
Table = trytb,