From 46e98339480d853fc78a014c34d7ff9fcaf13890 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 05 十二月 2024 14:09:02 +0800 Subject: [PATCH] 产线协议 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" index 1d1903e..4a92f35 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Seed/DBSeed.cs" @@ -19,7 +19,7 @@ { public class DBSeed { - private static string SeedDataFolder = "WIDESEAWCS_DB.DBSeed.Json/{0}.tsv"; + private static string SeedDataFolder = "WIDESEA_DB.DBSeed.Json/{0}.tsv"; /// <summary> /// 寮傛娣诲姞绉嶅瓙鏁版嵁 @@ -27,7 +27,7 @@ /// <param name="myContext"></param> /// <param name="WebRootPath"></param> /// <returns></returns> - public static async Task SeedAsync(DBContext dbContext, string WebRootPath) + public static void SeedAsync(DBContext dbContext, string WebRootPath) { try { @@ -40,9 +40,7 @@ Console.WriteLine("************ WIDESEA DataBase Set *****************"); - //Console.WriteLine($"Master DB ConId: {DBContext.ConnId}"); Console.WriteLine($"Master DB Type: {DBContext.DbType}"); - //Console.WriteLine($"Master DB ConnectString: {DBContext.ConnectionString}"); Console.WriteLine(); @@ -65,7 +63,7 @@ Console.WriteLine("Create Tables..."); var path = AppDomain.CurrentDomain.RelativeSearchPath ?? AppDomain.CurrentDomain.BaseDirectory; - var referencedAssemblies = System.IO.Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).ToArray(); + var referencedAssemblies = Directory.GetFiles(path, MainDb.AssemblyName).Select(Assembly.LoadFrom).ToArray(); var modelTypes = referencedAssemblies .SelectMany(a => a.DefinedTypes) @@ -89,9 +87,9 @@ #region AddSeedData if (seedData != "涓嶅瓨鍦ㄧ浉搴旂殑鐩綍") { - List<Dictionary<string, object>> dicFile = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(seedData); + List<Dictionary<string, object>>? dicFile = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(seedData); - if (dicFile.Count > 0) + if (dicFile != null && dicFile.Count > 0) { List<Dictionary<string, object>> dic = new List<Dictionary<string, object>>(); @@ -105,7 +103,7 @@ for (int i = 0; i < propertyInfos.Count; i++) { PropertyInfo propertyInfo = propertyInfos[i]; - SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); + SugarColumn? sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); if (sugarColumn != null) { if (!sugarColumn.IsIgnore) @@ -150,7 +148,7 @@ for (int i = 0; i < propertyInfos.Count; i++) { PropertyInfo propertyInfo = propertyInfos[i]; - SugarColumn sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); + SugarColumn? sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); if (sugarColumn != null) { if (!sugarColumn.IsIgnore) -- Gitblit v1.9.3