You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$"Type mismatch assigning value to property {properties[i].Name}: expected {rawResults[i].GetType().Name}, got {properties[i].PropertyType.Name}",
287
+
$"Type mismatch assigning value to property {properties[i].Name} of type {typeof(T).Name}: expected {rawResults[i].GetType().Name}, got {properties[i].PropertyType.Name}",
$"Type mismatch assigning value to field {fields[i].Name} of type {typeof(T).Name}: expected {rawResults[properties.Length+i].GetType().Name}, got {fields[i].FieldType.Name}",
279
304
ex
280
305
);
281
306
}
282
307
}
283
308
284
309
returninstance;
285
310
}
286
-
elseif(rawResults.Count==fields.Length)
311
+
elseif(rawResults.Count==properties.Length)// Just Properties
287
312
{
288
-
varinstance=Activator.CreateInstance<T>();
313
+
for(inti=0;i<properties.Length;i++)
314
+
{
315
+
try
316
+
{
317
+
properties[i].SetValue(instance,rawResults[i]);
318
+
}
319
+
catch(ArgumentExceptionex)
320
+
{
321
+
thrownewUnityException(
322
+
$"Type mismatch assigning value to property {properties[i].Name} of type {typeof(T).Name}: expected {rawResults[i].GetType().Name}, got {properties[i].PropertyType.Name}",
323
+
ex
324
+
);
325
+
}
326
+
}
289
327
328
+
returninstance;
329
+
}
330
+
elseif(rawResults.Count==fields.Length)// Just Fields
thrownewUnityException($"Type mismatch assigning value to field {fields[i].Name}: expected {rawResults[i].GetType().Name}, got {fields[i].FieldType.Name}",ex);
340
+
thrownewUnityException(
341
+
$"Type mismatch assigning value to field {fields[i].Name} of type {typeof(T).Name}: expected {rawResults[i].GetType().Name}, got {fields[i].FieldType.Name}",
$"The number of properties or fields in the target type do not match the number of results: expected {rawResults.Count}, got {properties.Length} properties and {fields.Length} fields"
352
+
$"The number of combined properties and fields in type {typeof(T).Name} does not match the number of results: expected {combinedCount}, got {properties.Length} properties and {fields.Length} fields with {rawResults.Count} results."
0 commit comments