fly 9 tháng trước cách đây
mục cha
commit
676a7db456
1 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 11 1
      Mapper/AutoMapping.cs

+ 11 - 1
Mapper/AutoMapping.cs

@@ -8,7 +8,7 @@ namespace WingServerCommon.Mapper
         /// <summary>
         /// Auto mapper instance
         /// </summary>
-        public static IMapper MapperInstance { get; }
+        public static IMapper MapperInstance { get; set; }
         private AutoMapping() { }
 
         static AutoMapping()
@@ -19,5 +19,15 @@ namespace WingServerCommon.Mapper
             });
             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;
+        }
     }
 }