/// <summary> /// Converts the destination <paramref name="value"/> to the source equivalent. /// </summary> /// <param name="value">The destination value.</param> /// <returns>The source value.</returns> public TSrceProperty ConvertToSrce(TDestProperty value) { if (value == null) return null; return (TSrceProperty)ReferenceDataConverterUtils.CheckConverted(((IPropertyMapperConverter)this).SrceType, ReferenceDataManager.Current[typeof(TSrceProperty)].GetByMappingValue(Name, value), value); }
/// <summary> /// Converts the source <paramref name="value"/> to the destination equivalent. /// </summary> /// <param name="value">The source value.</param> /// <returns>The destination value.</returns> public TDestProperty ConvertToDest(TSrceProperty value) { if (value == null) return default(TDestProperty); ReferenceDataConverterUtils.CheckIsValid(((IPropertyMapperConverter)this).SrceType, value); if (!value.TryGetMapping(Name, out IComparable mval)) throw new InvalidOperationException($"The ReferenceData does not containing a '{Name}' Mapping property/value."); return (TDestProperty)mval; }