mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 13:47:03 +08:00
Update ValueObject
This commit is contained in:
parent
657c1cd064
commit
18932437bc
@ -466,6 +466,7 @@ namespace SqlSugar
|
||||
{
|
||||
Check.ExceptionEasy($" {result.EntityName} "+ item.PropertyName+ " 存在重复定义 (IsOwnsOne) ", $" {result.EntityName} " + item.PropertyName + " Duplicate definition exists (IsOwnsOne)");
|
||||
}
|
||||
item.ForOwnsOnePropertyInfo = column.PropertyInfo;
|
||||
result.Columns.Add(item);
|
||||
}
|
||||
}
|
||||
|
@ -318,6 +318,11 @@ namespace SqlSugar
|
||||
}
|
||||
private static object GetValue(T item, EntityColumnInfo column)
|
||||
{
|
||||
if (column.ForOwnsOnePropertyInfo != null)
|
||||
{
|
||||
var owsPropertyValue= column.ForOwnsOnePropertyInfo.GetValue(item, null);
|
||||
return column.PropertyInfo.GetValue(owsPropertyValue, null);
|
||||
}
|
||||
if (StaticConfig.EnableAot)
|
||||
{
|
||||
return column.PropertyInfo.GetValue(item, null);
|
||||
|
@ -49,5 +49,6 @@ namespace SqlSugar
|
||||
public bool IsDisabledAlterColumn { get; set; }
|
||||
public string QuerySql { get; set; }
|
||||
public bool IsOwnsOne { get; set; }
|
||||
public PropertyInfo ForOwnsOnePropertyInfo { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user