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
Better error message in case property or field is not present in new() (#340)
* Also support Fields and give better error message.
* Select_Dynamic_WithField
* If only 1 argument, and the arg is ConstantExpression, just return the ConstantExpression
* .
varselect=context.Cars.Select<Car>(config,$"new {typeof(Car).FullName}(it.Key as Key, \"?\" as Brand)");
70
+
varselect=context.Cars.Select<Car>(config,$"new {typeof(Car).FullName}(it.Key as Key, \"?\" as Brand, string(null) as Color, string(\"e\") as Extra)");
users.Select<User>(config,"new User(1 as FieldDoesNotExist)");
88
+
}
89
+
catch(Exceptione)
90
+
{
91
+
Console.WriteLine(e);
92
+
}
93
+
94
+
foreach(dynamicxinusers.Select("new (FirstName, string(\"a\") as StrA, string('c') as StrCh, string(\"\") as StrEmpty1, string('\0') as StrEmpty2, string(null) as StrNull)"))
Check.ThatCode(()=>qry.Select<User>("new User(it.Bad as Bad)")).Throws<ParseException>().WithMessage("No property or field 'Bad' exists in type 'User'");
0 commit comments