Skip to content

Commit 3400c67

Browse files
author
zzzprojects
committed
Fix Audit + Batch Update for enum and Oracle
Fix Audit + Batch Update for enum and Oracle
1 parent 6c870ca commit 3400c67

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/shared/Z.EF.Plus.Audit.Shared/AuditConfiguration/IsAuditedEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public bool IsAuditedEntity(ObjectStateEntry entry)
2929
public bool IsAuditedEntity(EntityEntry entry)
3030
#endif
3131
{
32-
if (ExcludeIncludeEntityPredicates.Count == 0)
32+
if (ExcludeIncludeEntityPredicates.Count == 0 || entry.Entity == null)
3333
{
3434
return true;
3535
}

src/shared/Z.EF.Plus.BatchUpdate.Shared/BatchUpdate.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,14 @@ internal DbCommand CreateCommand<T>(ObjectQuery query, SchemaEntityType<T> entit
574574
}
575575
else
576576
{
577-
parameter.Value = paramValue ?? DBNull.Value;
577+
if (values[i].Item2.GetType().IsEnum)
578+
{
579+
parameter.Value = (int) paramValue;
580+
}
581+
else
582+
{
583+
parameter.Value = paramValue ?? DBNull.Value;
584+
}
578585
}
579586

580587

0 commit comments

Comments
 (0)