-
-
Notifications
You must be signed in to change notification settings - Fork 633
Open
Description
EFCore.BulkExtensions.PostgreSql/SqlAdapters/PostgreSql/PostgreSqlAdapter.cs
The function:
static object? GetPropertyValue(DbContext context, TableInfo tableInfo, string propertyName, T entity)
Throw exception due to value is not found in dictionary
The problem in the function is follow part:
object? propertyValue = entity;
string fullPropertyName = string.Empty;
foreach (var entry in propertyName.AsSpan().Split("."))
{
if (propertyValue == null)
{
return null;
}
if (fullPropertyName.Length > 0)
{
fullPropertyName += $"_{entry.ToString()}";
}
else
{
fullPropertyName = new string(entry.ToString());
}
propertyValue = tableInfo.FastPropertyDict[fullPropertyName].Get(propertyValue);
}
return propertyValue;
Eg propertyName is "id"
var entry in propertyName.AsSpan().Split(".") generates a range object and range object to string in follow code
fullPropertyName = new string(entry.ToString()); gives "[0..2] not "id"
I made follow change to the code just to get it to work.
foreach (var entry in propertyName.Split(".").AsSpan())
However I dont know what other implication it will give for more complex projects.
brunowarmling, shaybenh7 and Gendolph
Metadata
Metadata
Assignees
Labels
No labels