Skip to content
Complimentary library to AutoMapper that creates Mapper classes that need async operations to Map
C#
Branch: master
Clone or download
Latest commit 428310d Feb 10, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
misc/AsyncMapperTester
src/Narochno.AsyncMapper Make a beta1 Feb 10, 2017
.gitattributes
.gitignore Initial commit Feb 9, 2017
Narochno.AsyncMapper.sln Sample added Feb 9, 2017
README.md
appveyor.yml
global.json Sample added Feb 9, 2017

README.md

Narochno.AsyncMapper

This is a library that sits on top of AutoMapper and aims to basically provide TypeConverters which are async.

AutoMapper still does the generic work of mapping from objects. However, to fill in extra data, sometimes you need an async source.

Why async?

Problem domain:

  • Aggregate domain objects that are built from different sources of data.
  • The biggest source of non-database data is a cache, which could be all async!
  • Fitting a domain on top of an aging database schema is hard. So lots of code may be required to adapt this schema to a domain. Other async sources may be required.

Fitting the glue of building/mapping a domain object from data into a AutoMapper mapping just makes sense.

How does it work?

  • Use IAsyncMapper instead of IMapper in your code.
  • Implement IAsyncMapping for your desired mappers.
  • AsyncMapper will fallback to IMapper when an instance of IAsyncMapping for the requested map isn't found.

Collection Handling

  • IAsyncMapper will do a loop for collections like IMapper will do.
  • Implement IAsyncCollectionMapping for optimized handling of IEnumerable mappings for batching async operations.

Components in a Toy Sample

Future work

  • Optimize/cache reflection operations.
  • Support more than netstandard1.6 ?
  • Support using Dependency Injection other than through IServiceProvider ?
You can’t perform that action at this time.