using AutoMapper; using SysDataLibs.TableClass; namespace Gs.TransData.WebApi.Helper { public class AutoMapConfiguration { public static void Configure() { Mapper.Initialize(cfg => { cfg.AddProfile(); });//增加对 ModelProfile的初始化 Mapper.AssertConfigurationIsValid(); } } public class AutoMapProfile: Profile { public AutoMapProfile() { CreateMap().ForMember(a => a.CardIndex,b=>b.Ignore()).ForMember(a => a.LicenseNo, b => b.Ignore()).ForMember(a => a.IdCode, b => b.Ignore()).ForMember(a => a.UnitName, b => b.Ignore()).ForMember(a => a.PositionNo, b => b.Ignore()).ForMember(a => a.CorpNameName, b => b.Ignore()); CreateMap(); ; } } }