darrencauthon / automapperassist Goto Github PK
View Code? Open in Web Editor NEWAssists using and testing AutoMapper.
Assists using and testing AutoMapper.
I was looking at this interesting project, and while wondering where to hook my custom mappings, I saw this public (and not virtual) DefineMap overload, which is mystery for me. What it is for?
If I want to add few "custom" mappings on top of the by-default ones, or to change some of them, where is the most appropriate place to do that? In the DefineMap override(configuration)?
Cheers,
Currently, both CreateSet and CreateInstance use mappingEngine.Map
I needed to intercept and log particular data when some mapping fails - i.e. some identifying property of the source. To get this, I had to override both methods.
If CreateSet in the select statement uses CreateInstance instead of engine.Map, the user would need to override only create instance.
The above applies if some custom stuff needs to happen for each element as well.
Please, let me know what you thing about this, and I'll create a pull request - it's just a 1 line change.
Cheers
Current version of AutoMapperAssist on Nuget requires AutoMapper >=v2.0 - but fails to run with AutoMapper v3.0 (the current version).
Also, AutoMapperAssist can no longer be installed with the new version of Nuget (that ships with VS2012.4 RC2) - installation fails with:
Install failed. Rolling back...
Authors is required.
The version of AutoMapper that the nuget package uses is old.
Thanks for your response on #2.
Now I'm fighting with something else. Let's say I created a mapper for a child object(s). And I'd like to inject it into a new mapper for a parent object. Looks like I can not find an easy way for this. I mean something like
public class ChildDtoToChildMapper : Mapper
{
public override DefineMap(...){..do mapping for child }
}
public class ParentDtoToParent
{
private readonly Mapper childMapper;
public ParentDtoToParent(Mapper childMapper)
{ this.childMapper = mapper; }
publci override void DefineMap(....)
{
//...create map for the parrent
// ??? how to use the injected mapper for ParentDto.ChildDto ???
}
}
Any pointers?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.