mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-01 22:16:34 +08:00
更改了拖入的DLL显示名称
尝试添加了web自动化测试(基于Selenium)
This commit is contained in:
@@ -42,13 +42,17 @@ namespace Serein.Tool
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject<T>(input);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
// return default(T);
|
||||
|
||||
return default;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +83,9 @@ namespace Serein.Tool
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static bool IsExistRows(DataTable dt)
|
||||
@@ -111,10 +117,14 @@ namespace Serein.Tool
|
||||
{
|
||||
if (entitys == null || entitys.Count < 1)
|
||||
{
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Type type = entitys[0].GetType();
|
||||
|
||||
PropertyInfo[] properties = type.GetProperties();
|
||||
DataTable dataTable = new DataTable();
|
||||
for (int i = 0; i < properties.Length; i++)
|
||||
@@ -124,16 +134,22 @@ namespace Serein.Tool
|
||||
|
||||
foreach (T entity in entitys)
|
||||
{
|
||||
|
||||
object obj = entity;
|
||||
|
||||
|
||||
if (obj.GetType() != type)
|
||||
{
|
||||
throw new Exception("要转换的集合元素类型不一致");
|
||||
}
|
||||
|
||||
|
||||
object[] array = new object[properties.Length];
|
||||
for (int j = 0; j < properties.Length; j++)
|
||||
{
|
||||
|
||||
array[j] = properties[j].GetValue(obj, null);
|
||||
|
||||
}
|
||||
|
||||
dataTable.Rows.Add(array);
|
||||
|
||||
Reference in New Issue
Block a user