|
@@ -33,7 +33,7 @@ namespace InABox.Core
|
|
|
public String Source { get; }
|
|
|
public String Target { get; }
|
|
|
|
|
|
- private readonly Func<TLinkedEntity?, TType, Result<TType>>? _func;
|
|
|
+ private readonly Func<TLinkedEntity?, TType, Result<TType, string>>? _func;
|
|
|
|
|
|
public override string ToString()
|
|
|
{
|
|
@@ -43,7 +43,7 @@ namespace InABox.Core
|
|
|
public LinkedProperty(Expression<Func<TLinkedEntity, TEntityLink>> path,
|
|
|
Expression<Func<TEntityLink?, TType>> source,
|
|
|
Expression<Func<TLinkedEntity?, TType>> target,
|
|
|
- Func<TLinkedEntity?,TType, Result<TType>>? func = null)
|
|
|
+ Func<TLinkedEntity?,TType, Result<TType, string>>? func = null)
|
|
|
{
|
|
|
Path = CoreUtils.GetFullPropertyName(path, ".");
|
|
|
Source = CoreUtils.GetFullPropertyName(source, ".");
|
|
@@ -61,9 +61,7 @@ namespace InABox.Core
|
|
|
if (_func != null)
|
|
|
{
|
|
|
var result = _func(to as TLinkedEntity, value);
|
|
|
- if (!result.IsSuccess)
|
|
|
- return;
|
|
|
- value = result.Value;
|
|
|
+ if (!result.Get(out value, out var _)) return;
|
|
|
}
|
|
|
CoreUtils.SetPropertyValue(to, Target, value);
|
|
|
}
|