/// <inheritdoc/> bool IHalRepository.TryGetTransformer(Type type, [MaybeNullWhen(returnValue: false)] out ITypeTransformer transformer) { if (!_transformations.TryGetValue(type, out var transformationMap)) { transformer = default; return(false); } transformer = new TypeTransformer(transformationMap, _serviceProvider); return(true); }
public TypeTransformerRepository WithTypeTransformer <T1, T2> ( [NotNull] Type type, [NotNull] ITypeTransformer <T1, T2> transformer ) { if (!_typeTransformers.ContainsKey(type)) { _typeTransformers.Add(type, transformer); } return(this); }
/// <inheritdoc/> bool IHalRepository.TryGetTransformer(Type type, out ITypeTransformer transformer) { if (type is null) { throw new ArgumentNullException(nameof(type)); } if (!_transformations.TryGetValue(type, out var transformationMap)) { transformer = default; return(false); } transformer = new TypeTransformer(transformationMap, _serviceProvider); return(true); }