Skip to content

Commit

Permalink
Fixed truncates.
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Mar 25, 2015
1 parent e2f6b33 commit 809fe89
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Abp.Zero/Auditing/AuditLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,20 @@ public class AuditLog : Entity<long>
/// <returns>The <see cref="AuditLog"/> object that is created using <see cref="auditInfo"/></returns>
public static AuditLog CreateFromAuditInfo(AuditInfo auditInfo)
{
//TODO: Truncate should return null if argument is null. Implement this in Abp then change here.

return new AuditLog
{
TenantId = auditInfo.TenantId,
UserId = auditInfo.UserId,
ServiceName = auditInfo.ServiceName.Truncate(MaxServiceNameLength),
MethodName = auditInfo.MethodName.Truncate(MaxMethodNameLength),
Parameters = auditInfo.Parameters.Truncate(MaxParametersLength),
ServiceName = (auditInfo.ServiceName ?? "").Truncate(MaxServiceNameLength),
MethodName = (auditInfo.MethodName ?? "").Truncate(MaxMethodNameLength),
Parameters = (auditInfo.Parameters ?? "").Truncate(MaxParametersLength),
ExecutionTime = auditInfo.ExecutionTime,
ExecutionDuration = auditInfo.ExecutionDuration,
ClientIpAddress = auditInfo.ClientIpAddress.Truncate(MaxClientIpAddressLength),
ClientName = auditInfo.ClientName.Truncate(MaxClientNameLength),
BrowserInfo = auditInfo.BrowserInfo.Truncate(MaxBrowserInfoLength)
ClientIpAddress = (auditInfo.ClientIpAddress ?? "").Truncate(MaxClientIpAddressLength),
ClientName = (auditInfo.ClientName ?? "").Truncate(MaxClientNameLength),
BrowserInfo = (auditInfo.BrowserInfo ?? "").Truncate(MaxBrowserInfoLength)
};
}

Expand Down

0 comments on commit 809fe89

Please sign in to comment.