123456789101112131415161718192021222324252627282930313233 |
- using AutoMapper;
- using System;
- namespace WingServerCommon.Mapper
- {
- public class AutoMapping
- {
- /// <summary>
- /// Auto mapper instance
- /// </summary>
- public static IMapper MapperInstance { get; set; }
- private AutoMapping() { }
- static AutoMapping()
- {
- var config = new MapperConfiguration(cfg =>
- {
- cfg.AddMaps(AppDomain.CurrentDomain.GetAssemblies());
- });
- MapperInstance = new AutoMapper.Mapper(config);
- }
- public static bool LoadAutoMapping()
- {
- var config = new MapperConfiguration(cfg =>
- {
- cfg.AddMaps(AppDomain.CurrentDomain.GetAssemblies());
- });
- MapperInstance = new AutoMapper.Mapper(config);
- return true;
- }
- }
- }
|