AutoMapper, pushing work to the database

I`ve been using AutoMapper for a long time. It’s a tool that allows to map from one object graph to another through a convention based configuration system. My only objection was that i was scared that the projection was done in memory, meaning i had to load up whatever data i needed, then do the projection.

On one of the projects i manage, i saw the use of AutoMapper directly in the entity framework query. My first reaction was : it will load everything, then project, then filter…

Well, surprise surprise, AutoMapper has this mode where it will push the projection stuff to the source (through expressions) and hence, allow you to map in the database engine… now that is cool !


No comments yet.