このコードはstackoverflowで見つけましたが、FlatLoopValueInjectionを処理できないことに気付きました。これを処理したいのですが、方法がわかりません。
public static ICollection<TTo> InjectFrom<TFrom, TTo>(this ICollection<TTo> to, IEnumerable<TFrom> from) where TTo : new()
{
foreach (var source in from)
{
var target = new TTo();
target.InjectFrom(source);
to.Add(target);
}
return to;
}
これを更新する必要があることは知っていますが target.InjectFrom(source);
、何か(FlatLoopValueInjection、UnflatLoopValueInjectionなど)を取り込んで使用できるとしたら何が良いかわかりません