@@ -40,6 +40,7 @@ public sealed class Mapped<In, Out> : CollectionEnvelope<Out>
40
40
/// <param name="src">source items</param>
41
41
public Mapped ( Func < In , Out > mapping , params In [ ] src ) : this ( mapping , new ManyOf < In > ( src ) )
42
42
{ }
43
+ public static Mapped < In , Out > New ( Func < In , Out > mapping , params In [ ] src ) => new Mapped < In , Out > ( mapping , src ) ;
43
44
44
45
/// <summary>
45
46
/// ctor
@@ -49,6 +50,7 @@ public sealed class Mapped<In, Out> : CollectionEnvelope<Out>
49
50
public Mapped ( Func < In , Out > mapping , IEnumerator < In > src ) : this (
50
51
mapping , new ManyOf < In > ( src ) )
51
52
{ }
53
+ public static Mapped < In , Out > New ( Func < In , Out > mapping , IEnumerator < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
52
54
53
55
/// <summary>
54
56
/// ctor
@@ -58,6 +60,7 @@ public Mapped(Func<In, Out> mapping, IEnumerator<In> src) : this(
58
60
public Mapped ( Func < In , Out > mapping , IEnumerable < In > src ) : this (
59
61
mapping , new LiveCollection < In > ( src ) )
60
62
{ }
63
+ public static Mapped < In , Out > New ( Func < In , Out > mapping , IEnumerable < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
61
64
62
65
/// <summary>
63
66
/// ctor
@@ -69,5 +72,22 @@ public Mapped(Func<In, Out> mapping, ICollection<In> src) : base(() =>
69
72
false
70
73
)
71
74
{ }
75
+ public static Mapped < In , Out > New ( Func < In , Out > mapping , ICollection < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
76
+ }
77
+
78
+ // <summary>
79
+ /// A collection which is mapped to the output type.
80
+ /// </summary>
81
+ /// <typeparam name="In">source type</typeparam>
82
+ /// <typeparam name="Out">target type</typeparam>
83
+ public static class Mapped
84
+ {
85
+ public static Mapped < In , Out > New < In , Out > ( Func < In , Out > mapping , params In [ ] src ) => new Mapped < In , Out > ( mapping , src ) ;
86
+
87
+ public static Mapped < In , Out > New < In , Out > ( Func < In , Out > mapping , IEnumerator < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
88
+
89
+ public static Mapped < In , Out > New < In , Out > ( Func < In , Out > mapping , IEnumerable < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
90
+
91
+ public static Mapped < In , Out > New < In , Out > ( Func < In , Out > mapping , ICollection < In > src ) => new Mapped < In , Out > ( mapping , src ) ;
72
92
}
73
93
}
0 commit comments