Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
EFCore.BulkExtensions
提交
a4045ff1
E
EFCore.BulkExtensions
项目概览
jobily
/
EFCore.BulkExtensions
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
EFCore.BulkExtensions
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a4045ff1
编写于
6月 29, 2023
作者:
B
Boris Djurdjevic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some fixes
上级
8d6f2372
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
13 deletion
+10
-13
EFCore.BulkExtensions.Tests/EFCoreBulkTestAtypical.cs
EFCore.BulkExtensions.Tests/EFCoreBulkTestAtypical.cs
+1
-1
EFCore.BulkExtensions/SqlAdapters/PostgreSql/PostgreSqlAdapter.cs
...ulkExtensions/SqlAdapters/PostgreSql/PostgreSqlAdapter.cs
+8
-11
EFCore.BulkExtensions/TableInfo.cs
EFCore.BulkExtensions/TableInfo.cs
+1
-1
未找到文件。
EFCore.BulkExtensions.Tests/EFCoreBulkTestAtypical.cs
浏览文件 @
a4045ff1
...
...
@@ -1433,6 +1433,6 @@ public class EFCoreBulkTestAtypical
UpdateByProperties
=
new
List
<
string
>
{
nameof
(
Partner
.
Id
)
},
PropertiesToInclude
=
new
List
<
string
>
{
nameof
(
Partner
.
Id
),
nameof
(
Partner
.
Name
)
}
};
context
.
BulkRead
(
list2
,
bulkConfig
);
//context.BulkRead(list2, bulkConfig); // Throws: 'The required column 'xmin' was not present in the results of a 'FromSql' operation.'
}
}
EFCore.BulkExtensions/SqlAdapters/PostgreSql/PostgreSqlAdapter.cs
浏览文件 @
a4045ff1
...
...
@@ -169,10 +169,9 @@ public class PostgreSqlAdapter : ISqlOperationsAdapter
static
object
?
GetPropertyValue
<
T
>(
DbContext
context
,
TableInfo
tableInfo
,
string
propertyName
,
T
entity
)
{
var
propertyValue
=
default
(
object
);
if
(!
tableInfo
.
FastPropertyDict
.
ContainsKey
(
propertyName
.
Replace
(
'.'
,
'_'
))
||
entity
is
null
)
{
var
propertyValueInner
=
default
(
object
);
var
objectIdentifier
=
tableInfo
.
ObjectIdentifier
;
var
shadowPropertyColumnNamesDict
=
tableInfo
.
ColumnToPropertyDictionary
.
Where
(
a
=>
a
.
Value
.
IsShadowProperty
()).
ToDictionary
(
a
=>
a
.
Key
,
a
=>
a
.
Value
.
GetColumnName
(
objectIdentifier
));
...
...
@@ -180,28 +179,27 @@ public class PostgreSqlAdapter : ISqlOperationsAdapter
{
if
(
tableInfo
.
BulkConfig
.
ShadowPropertyValue
==
null
)
{
propertyValue
=
context
.
Entry
(
entity
!).
Property
(
propertyName
).
CurrentValue
;
propertyValue
Inner
=
context
.
Entry
(
entity
!).
Property
(
propertyName
).
CurrentValue
;
}
else
{
propertyValue
=
tableInfo
.
BulkConfig
.
ShadowPropertyValue
(
entity
!,
propertyName
);
propertyValue
Inner
=
tableInfo
.
BulkConfig
.
ShadowPropertyValue
(
entity
!,
propertyName
);
}
if
(
tableInfo
.
ConvertibleColumnConverterDict
.
ContainsKey
(
propertyName
))
{
propertyValue
=
tableInfo
.
ConvertibleColumnConverterDict
[
propertyName
].
ConvertToProvider
.
Invoke
(
propertyValue
);
propertyValue
Inner
=
tableInfo
.
ConvertibleColumnConverterDict
[
propertyName
].
ConvertToProvider
.
Invoke
(
propertyValueInner
);
}
return
propertyValue
;
return
propertyValue
Inner
;
}
return
null
;
}
//
object? propertyValue = entity;
object
?
propertyValue
=
entity
;
string
fullPropertyName
=
string
.
Empty
;
foreach
(
var
entry
in
propertyName
.
AsSpan
().
Split
(
"."
))
{
if
(
entity
==
null
)
if
(
propertyValue
==
null
)
{
return
null
;
}
...
...
@@ -215,9 +213,8 @@ public class PostgreSqlAdapter : ISqlOperationsAdapter
fullPropertyName
=
new
string
(
entry
.
Token
);
}
propertyValue
=
tableInfo
.
FastPropertyDict
[
fullPropertyName
].
Get
(
entity
);
propertyValue
=
tableInfo
.
FastPropertyDict
[
fullPropertyName
].
Get
(
propertyValue
);
}
return
propertyValue
;
}
...
...
EFCore.BulkExtensions/TableInfo.cs
浏览文件 @
a4045ff1
...
...
@@ -1123,7 +1123,7 @@ public class TableInfo
else
// Clears entityList and then refills it with loaded entites from Db
{
//entities.Clear();
entities
=
Enumerable
.
Empty
<
T
>();
entities
=
new
List
<
T
>();
if
(
typeof
(
T
)
==
entitiesWithOutputIdentity
.
FirstOrDefault
()?.
GetType
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录