When using FromSql, parameters can end up named without the @ at the beginning. This leads to the failure to match it to the Sql where the string is generated with the @.

If we can't find the parameter using the normal name, try to pick it up when excluding the @
7.0-servicing
Christopher Jolly 2 years ago
parent 6f38fe6e90
commit a93c205194

@ -693,6 +693,12 @@ namespace EntityFrameworkCore.Jet.Data
var parameter = unusedParameters
.FirstOrDefault(p => placeholder.Name.Equals(p.ParameterName, StringComparison.Ordinal));
if (parameter == null)
{
parameter = unusedParameters
.FirstOrDefault(p => !p.ParameterName.StartsWith('@') && placeholder.Name.Substring(1).Equals(p.ParameterName, StringComparison.Ordinal));
}
if (parameter != null)
{
placeholder.Parameter = parameter;

Loading…
Cancel
Save