Files
InventoryTracker/InventoryTraker.Web/App_Start/AutoMapperConfig.cs
T
2016-08-22 11:03:00 -04:00

21 lines
900 B
C#

using Heroic.AutoMapper;
using InventoryTraker.Web;
using InventoryTraker.Web.Controllers;
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(AutoMapperConfig), "Configure")]
namespace InventoryTraker.Web
{
public static class AutoMapperConfig
{
public static void Configure()
{
//NOTE: By default, the current project and all referenced projects will be scanned.
// You can customize this by passing in a lambda to filter the assemblies by name,
// like so:
//HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies(x => x.Name.StartsWith("YourPrefix"));
//HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies();
//If you run into issues with the maps not being located at runtime, try using this method instead:
HeroicAutoMapperConfigurator.LoadMapsFromAssemblyContainingTypeAndReferencedAssemblies<ControllerBase>();
}
}
}