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.
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.
- Use
IAsyncMapper
instead ofIMapper
in your code. - Implement
IAsyncMapping
for your desired mappers. AsyncMapper
will fallback toIMapper
when an instance ofIAsyncMapping
for the requested map isn't found.
IAsyncMapper
will do a loop for collections likeIMapper
will do.- Implement
IAsyncCollectionMapping
for optimized handling ofIEnumerable
mappings for batching async operations.
- Setup
AutoMapper
usingProfile
classes for organization: MappingProfile.cs - Use
AutoMapper
in your async mappers if needed like so: SourceClassMapping.cs - Glue together! Program.cs
- Optimize/cache reflection operations.
- Support more than
netstandard1.6
? - Support using Dependency Injection other than through
IServiceProvider
?