|
|
|
@ -52,7 +52,7 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency |
|
|
|
CorrelationIdProvider = correlationIdProvider; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual bool ShouldSaveAudit(MethodInfo methodInfo, bool defaultValue = false, bool ignoreIntegrationServiceAttribute = false) |
|
|
|
public virtual bool ShouldSaveAudit(MethodInfo? methodInfo, bool defaultValue = false, bool ignoreIntegrationServiceAttribute = false) |
|
|
|
{ |
|
|
|
if (methodInfo == null) |
|
|
|
{ |
|
|
|
@ -150,23 +150,23 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency |
|
|
|
|
|
|
|
public virtual AuditLogActionInfo CreateAuditLogAction( |
|
|
|
AuditLogInfo auditLog, |
|
|
|
Type type, |
|
|
|
Type? type, |
|
|
|
MethodInfo method, |
|
|
|
object[] arguments) |
|
|
|
object?[] arguments) |
|
|
|
{ |
|
|
|
return CreateAuditLogAction(auditLog, type, method, CreateArgumentsDictionary(method, arguments)); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual AuditLogActionInfo CreateAuditLogAction( |
|
|
|
AuditLogInfo auditLog, |
|
|
|
Type type, |
|
|
|
Type? type, |
|
|
|
MethodInfo method, |
|
|
|
IDictionary<string, object> arguments) |
|
|
|
IDictionary<string, object?> arguments) |
|
|
|
{ |
|
|
|
var actionInfo = new AuditLogActionInfo |
|
|
|
{ |
|
|
|
ServiceName = type != null |
|
|
|
? type.FullName |
|
|
|
? type.FullName! |
|
|
|
: "", |
|
|
|
MethodName = method.Name, |
|
|
|
Parameters = SerializeConvertArguments(arguments), |
|
|
|
@ -198,7 +198,7 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual string SerializeConvertArguments(IDictionary<string, object> arguments) |
|
|
|
protected virtual string SerializeConvertArguments(IDictionary<string, object?> arguments) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
@ -207,7 +207,7 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency |
|
|
|
return "{}"; |
|
|
|
} |
|
|
|
|
|
|
|
var dictionary = new Dictionary<string, object>(); |
|
|
|
var dictionary = new Dictionary<string, object?>(); |
|
|
|
|
|
|
|
foreach (var argument in arguments) |
|
|
|
{ |
|
|
|
@ -230,14 +230,14 @@ public class AuditingHelper : IAuditingHelper, ITransientDependency |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual Dictionary<string, object> CreateArgumentsDictionary(MethodInfo method, object[] arguments) |
|
|
|
protected virtual Dictionary<string, object?> CreateArgumentsDictionary(MethodInfo method, object?[] arguments) |
|
|
|
{ |
|
|
|
var parameters = method.GetParameters(); |
|
|
|
var dictionary = new Dictionary<string, object>(); |
|
|
|
var dictionary = new Dictionary<string, object?>(); |
|
|
|
|
|
|
|
for (var i = 0; i < parameters.Length; i++) |
|
|
|
{ |
|
|
|
dictionary[parameters[i].Name] = arguments[i]; |
|
|
|
dictionary[parameters[i].Name!] = arguments[i]; |
|
|
|
} |
|
|
|
|
|
|
|
return dictionary; |
|
|
|
|