summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/EnumerableMapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'slips/src/app/Marina/Infrastructure/EnumerableMapper.cs')
-rw-r--r--slips/src/app/Marina/Infrastructure/EnumerableMapper.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/slips/src/app/Marina/Infrastructure/EnumerableMapper.cs b/slips/src/app/Marina/Infrastructure/EnumerableMapper.cs
new file mode 100644
index 0000000..0ba9bca
--- /dev/null
+++ b/slips/src/app/Marina/Infrastructure/EnumerableMapper.cs
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+
+namespace Marina.Infrastructure {
+ internal class EnumerableMapper< TIn, TOut > : IMapper< IEnumerable< TIn >, IEnumerable< TOut > > {
+ public EnumerableMapper( IMapper< TIn, TOut > mapper ) {
+ _mapper = mapper;
+ }
+
+ public IEnumerable< TOut > MapFrom( IEnumerable< TIn > input ) {
+ foreach ( TIn item in input ) {
+ yield return _mapper.MapFrom( item );
+ }
+ }
+
+ private readonly IMapper< TIn, TOut > _mapper;
+ }
+} \ No newline at end of file