Exemplo n.º 1
0
 public static TSource SetValues<TSource, TValue>(
     this TSource source,
     Expression<Func<TSource, TValue>> setter)
 {
     var copierExpr = new Copier<TSource, TValue>().Rewrite(setter);
     var copier = copierExpr.Compile();
     return copier(source);
 }
    public static IEnumerable <TSource> UpdateValues <TSource, TValue>(
        this IEnumerable <TSource> source,
        Expression <Func <TSource, TValue> > setter)
    {
        var copierExpr = new Copier <TSource, TValue>().Rewrite(setter);
        var copier     = copierExpr.Compile();

        return(source.Select(copier));
    }