/// <summary> /// Translates the <see cref="IServiceResponse{TSource}"/> instance into an <see cref="IServiceResponse{TTarget}"/> /// using the specified <typeparamref name="TValueInjection"/> and custom <paramref name="mapper"/>. /// </summary> /// <typeparam name="TSource">The type of source object.</typeparam> /// <typeparam name="TTarget">The type of target object.</typeparam> /// <typeparam name="TValueInjection">The type of <see cref="IValueInjection"/> to use.</typeparam> /// <param name="source">Source instance to translate.</param> /// <param name="mapper">A custom anonymous object mapper used for post processing after value injection has taken place.</param> /// <returns>Instance of <see cref="IServiceResponse{TTarget}"/>.</returns> public static IServiceResponse <TTarget> BindInject <TSource, TTarget, TValueInjection>(this IServiceResponse <TSource> source, Func <TSource, Object> mapper = null) where TTarget : class, new() where TValueInjection : IValueInjection, new() { return(source.BindInject(Activator.CreateInstance <TTarget>(), Activator.CreateInstance <TValueInjection>(), mapper)); }
/// <summary> /// Translates the <see cref="IServiceResponse{TSource}"/> instance into an <see cref="IServiceResponse{TTarget}"/> /// using <see name="LoopValueInjection"/> and the optionally-specified <paramref name="mapper"/>. /// </summary> /// <typeparam name="TSource">The type of source object.</typeparam> /// <typeparam name="TTarget">The type of target object.</typeparam> /// <param name="source">Source instance to translate.</param> /// <param name="mapper">A custom anonymous object mapper used for post processing after value injection has taken place.</param> /// <returns>Instance of <see cref="IServiceResponse{TTarget}"/>.</returns> public static IServiceResponse <TTarget> BindInject <TSource, TTarget>(this IServiceResponse <TSource> source, Func <TSource, Object> mapper = null) where TTarget : class, new() { return(source.BindInject <TSource, TTarget, LoopValueInjection>(mapper)); }