瀏覽代碼

更新配置文件

CrazyIter 4 年之前
父節點
當前提交
da6b3301ea

+ 8 - 0
TEAMModelFunction/Properties/launchSettings.json

@@ -0,0 +1,8 @@
+{
+  "profiles": {
+    "TEAMModelFunction": {
+      "commandName": "Project",
+      "nativeDebugging": false
+    }
+  }
+}

+ 1 - 1
TEAMModelFunction/Startup.cs

@@ -18,7 +18,7 @@ namespace TEAMModelFunction
         {
          //   builder.Services.con
             builder.Services.AddHttpClient();
-            builder.Services.AddOptions<string>("AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;");
+            builder.Services.AddAzureCosmos("AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;");
         }
     }
 }

+ 2 - 1
TEAMModelFunction/local.settings.json

@@ -6,5 +6,6 @@
     "CosmosConnection": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;",
     "ConnectionBusName": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc="
 
-  }
+  },
+  "ConnectionStrings"
 }

+ 4 - 2
TEAMModelOS.SDK/DI/AzureCosmos/AzureCosmosFactory.cs

@@ -94,7 +94,8 @@ namespace TEAMModelOS.SDK.DI
         /// <returns></returns>
         public async Task InitializeDatabase()
         {
-            string[] DatabaseIds = BaseConfigModel.Configuration.GetSection("Azure:Cosmos:Database").Get<string[]>();
+            //    string[] DatabaseIds = BaseConfigModel.Configuration.GetSection("Azure:Cosmos:Database").Get<string[]>();
+            string[] DatabaseIds =new string[] { "TEAMModelOS" };
             bool isMonitor = false;
             string leases = "leases";
             if (DatabaseIds != null)
@@ -110,7 +111,8 @@ namespace TEAMModelOS.SDK.DI
                 }
             }
             //获取数据库所有的表
-            List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(BaseConfigModel.Configuration.GetSection("Azure:Cosmos:ScanModel").Get<string[]>() );
+            // List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(BaseConfigModel.Configuration.GetSection("Azure:Cosmos:ScanModel").Get<string[]>() );
+            List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(new string[] { "TEAMModelOS" });
             foreach (Type type in types)
             {
                 string PartitionKey = AzureCosmosUtil.GetPartitionKey(type);