feat(template): stamp ElementDataType on instance attribute overrides
Set existingOverride.ElementDataType and newOverride.ElementDataType from templateAttr.ElementDataType in both the update and create branches of SetAttributeOverrideAsync, so the persisted InstanceAttributeOverride row always carries the element type for later central normalizer use (#93/M3).
This commit is contained in:
@@ -172,6 +172,7 @@ public class InstanceService
|
||||
if (existingOverride != null)
|
||||
{
|
||||
existingOverride.OverrideValue = overrideValue;
|
||||
existingOverride.ElementDataType = templateAttr.ElementDataType;
|
||||
await _repository.UpdateInstanceAttributeOverrideAsync(existingOverride, cancellationToken);
|
||||
await _repository.SaveChangesAsync(cancellationToken);
|
||||
|
||||
@@ -185,7 +186,8 @@ public class InstanceService
|
||||
var newOverride = new InstanceAttributeOverride(attributeName)
|
||||
{
|
||||
InstanceId = instanceId,
|
||||
OverrideValue = overrideValue
|
||||
OverrideValue = overrideValue,
|
||||
ElementDataType = templateAttr.ElementDataType
|
||||
};
|
||||
|
||||
await _repository.AddInstanceAttributeOverrideAsync(newOverride, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user