[CHANGE] Fixed auditing, storing images from account import
This commit is contained in:
@@ -36,11 +36,11 @@ public class AuditInterceptor : SaveChangesInterceptor
|
||||
|
||||
foreach (var entry in entries)
|
||||
{
|
||||
var primaryKey = entry.Properties.First(p => p.Metadata.IsPrimaryKey()).CurrentValue?.ToString() ?? "Unknown";
|
||||
var primaryKey = entry.Properties.First(p => p.Metadata.IsPrimaryKey()).CurrentValue?.ToString();
|
||||
|
||||
var declaredProperties = entry.Entity.GetType()
|
||||
.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance)
|
||||
.Where(p => !Attribute.IsDefined(p.DeclaringType!, typeof(NoAuditAttribute)))
|
||||
.Where(p => !Attribute.IsDefined(p.DeclaringType!, typeof(NoAuditAttribute), false))
|
||||
.Select(p => p.Name)
|
||||
.ToHashSet();
|
||||
|
||||
@@ -78,6 +78,7 @@ public class AuditInterceptor : SaveChangesInterceptor
|
||||
{
|
||||
return new EntityAudit
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
EntityName = entry.Entity.GetType().Name,
|
||||
EntityId = primaryKey ?? "Unknown",
|
||||
PropertyName = prop.Metadata.Name,
|
||||
|
Reference in New Issue
Block a user