ASP.NET MVC 4 – AutoMapper Both Ways 方法

 
ASP.NET MVC 4 – AutoMapper Both Ways 方法

   AutoMapperConfig.cs
 
   using System;
   using System.Collections.Generic;
   using AutoMapper;
   using ProductServiceLibrary;
 
   namespace MvcApplication
   {
      public class AutoMapperConfig
      {
         public static void Configure()
         {
            Mapper.CreateMap<ProductServiceLibrary.ProductEntity, MvcApplication.Models.Product>().ReverseMap();
            Mapper.AssertConfigurationIsValid();
         }
      }
   }