1
This commit is contained in:
@@ -13,6 +13,7 @@ using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Utils;
|
||||
using Mapster;
|
||||
using Tnb.Common.Extension;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
@@ -47,18 +48,8 @@ namespace Tnb.EquipMgr
|
||||
var pk = id;
|
||||
TDest entity = new();
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
if (!PropertySet<TDest>.ValueFactories.TryGetValue(mColumnName, out Action<object, object>? setGroupIdAction))
|
||||
{
|
||||
setGroupIdAction = PropertySet<TDest>.CreateSetPropertyValueAction(mColumnName);
|
||||
PropertySet<TDest>.ValueFactories.Add(mColumnName, setGroupIdAction);
|
||||
}
|
||||
setGroupIdAction(entity, input.item_group_id);
|
||||
if (!PropertySet<TDest>.ValueFactories.TryGetValue(name, out Action<object, object>? setAction))
|
||||
{
|
||||
setAction = PropertySet<TDest>.CreateSetPropertyValueAction(name);
|
||||
PropertySet<TDest>.ValueFactories.Add(name, setAction);
|
||||
}
|
||||
setAction(entity, pk);
|
||||
entity.PropertySetValue<TDest>(mColumnName, input.item_group_id);
|
||||
entity.PropertySetValue<TDest>(name,pk);
|
||||
entities.Add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user