Skip to content

Commit

Permalink
More Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
garywoodfine committed Feb 21, 2018
1 parent 0994116 commit 4e96419
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/Define-Maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ It is in the CustomMap method that you can use all the power and functionality o

::
public class ComplexDomainObject :ICustomMap
public class ComplexDomainObject : ICustomMap
{
public string Firstname { get; set; }
public string LastName { get; set; }
public string Summary { get; set; }
public string Title { get; set; }
public int Age { get; set; }

public void CustomMap(IMapperConfigurationExpression configuration)
{
configuration.CreateMap<ComplexDomainObject, SimpleEntity>()
Expand Down
28 changes: 28 additions & 0 deletions docs/MapConfigurationFactory.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
Mapping Configuration Factory
=============================

The MapConfigurationFactory is the mechanism you'll use to register your Mappings within your application. There are a
number of methods available to help you to do so. However the most popular and easiest one to use is the Scan method.

Scan
----

The Scan method makes use of Reflection to query all referenced assemblies to all the Types that implement the IMapTo, IMapFrom and
the ICustomMap interfaces and register them within your application domain.

To do so ise really easy, for instance if you are working on a Web Application (MVC or API), all you need to do is within you
Configure method is

::
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
//Set up code for automapper configuration
MapConfigurationFactory.Scan<Startup>();
}
}

0 comments on commit 4e96419

Please sign in to comment.