修复最新简化集合方式的报错

This commit is contained in:
2023-11-16 15:15:00 +08:00
parent dca3712828
commit 9e42729e04
4 changed files with 37 additions and 35 deletions

View File

@@ -65,19 +65,19 @@ public partial class Vmodel : Entity
/// 表字段属性
/// </summary>
[SugarColumn(ColumnName = "db_props", IsNullable = false, IsJson = true)]
public List<VmDbProp> dbProps { get; set; } = [];
public List<VmDbProp> dbProps { get; set; } = new List<VmDbProp>();
/// <summary>
/// 导航属性
/// </summary>
[SugarColumn(ColumnName = "nav_props", IsNullable = true, IsJson = true)]
public List<VmNavProp> navProps { get; set; } = [];
public List<VmNavProp> navProps { get; set; } = new List<VmNavProp>();
/// <summary>
/// 计算属性
/// </summary>
[SugarColumn(ColumnName = "cal_props", IsNullable = true, IsJson = true)]
public List<VmCalProp> calProps { get; set; } = [];
public List<VmCalProp> calProps { get; set; } = new List<VmCalProp>();
/// <summary>
/// 排序
@@ -225,7 +225,7 @@ public partial class Vmodel : Entity
/// <returns></returns>
public DObject GetDefaultDObject()
{
DObject obj = [];
DObject obj = new ();
foreach (VmDbProp p in dbProps)
{
obj.Add(p.code, p.GetDefaultValue()!);
@@ -239,7 +239,7 @@ public partial class Vmodel : Entity
/// <returns></returns>
public DObject ToCreateEntity(DObject input, IUserManager user)
{
DObject obj = [];
DObject obj = new ();
foreach (VmDbProp p in dbProps)
{
if (input.ContainsKey(p.code))
@@ -273,7 +273,7 @@ public partial class Vmodel : Entity
/// <returns></returns>
public DObject ToUpdateEntity(DObject input, IUserManager user)
{
DObject obj = [];
DObject obj = new ();
foreach (VmDbProp p in dbProps)
{
if (input.ContainsKey(p.code))