Преглед на файлове

修复一个MongoHelper错误,会多次往Bson库中注册ComponentWithId,结果报错

tanghai преди 7 години
родител
ревизия
010b133fe9
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      Server/Model/Base/Helper/MongoHelper.cs

+ 5 - 0
Server/Model/Base/Helper/MongoHelper.cs

@@ -22,6 +22,11 @@ namespace ETModel
 				{
 				{
 					continue;
 					continue;
 				}
 				}
+				
+				if(type == typeof(ComponentWithId) || type == typeof(Component) || type == typeof(Entity))
+				{
+					continue;
+				}
 				methodInfo.MakeGenericMethod(type).Invoke(null, null);
 				methodInfo.MakeGenericMethod(type).Invoke(null, null);
 			}
 			}