Skip to content

Commit dabc8ad

Browse files
committed
代码整理
1 parent feb944d commit dabc8ad

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

AntJob.Extensions/SqlSection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static SqlSection[] ParseAll(String sqls)
4848
if (sqls.IsNullOrEmpty()) return list.ToArray();
4949

5050
// 两个换行隔开片段
51-
var ss = sqls.Split(new[] { "\r\n\r", "\r\r", "\n\n" }, StringSplitOptions.RemoveEmptyEntries);
51+
var ss = sqls.Split(["\r\n\r\n", "\r\n\r", "\r\r", "\n\n"], StringSplitOptions.RemoveEmptyEntries);
5252
var connName = "";
5353
foreach (var item in ss)
5454
{
@@ -61,7 +61,7 @@ public static SqlSection[] ParseAll(String sqls)
6161
else
6262
connName = section.ConnName;
6363

64-
if (section.ConnName.IsNullOrEmpty()) throw new Exception("未指定连接名!");
64+
if (section.ConnName.IsNullOrEmpty()) throw new XException($"未指定连接名!{section.Sql}");
6565

6666
list.Add(section);
6767
}
@@ -154,7 +154,7 @@ public Int32 BatchInsert(DbTable dt)
154154
if (table == null)
155155
{
156156
var ioc = ObjectContainer.Current;
157-
table = ioc.Resolve<IDataTable>();
157+
table = ioc.GetService<IDataTable>();
158158
table.TableName = tableName;
159159

160160
for (var i = 0; i < dt.Columns.Length; i++)

0 commit comments

Comments
 (0)