Skip to content

Commit 032d461

Browse files
committed
当无法确定数据导入操作成员时抛出异常。 😑
1 parent da5cc81 commit 032d461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zongsoft.Data/src/Common/DataImporterBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ private static MemberCollection GetMembers(DataImportContext context)
6060
else
6161
GenerateMembersWithInfo(context, members);
6262

63-
return members;
63+
return members.Count > 0 ? members :
64+
throw new DataOperationException($"The members of the import operation cannot be determined based on the specified '{context.ModelType}' type.");
6465

6566
static MemberInfo GetMemberInfo(Type type, string name) =>
6667
(MemberInfo)type.GetProperty(name, BindingFlags.Public | BindingFlags.Instance) ??

0 commit comments

Comments
 (0)