public static ActivityAuditModel ToAuditModel(this IOwinContext context, string requestIdOverride)
        {
            var model = new ActivityAuditModel();

            var owinRequestId = context.Environment[OwinRequestId].ToString();

            model.RequestId  = EmptyId.Equals(owinRequestId, StringComparison.InvariantCultureIgnoreCase) ? requestIdOverride : owinRequestId;
            model.IpAddress  = context.Request.RemoteIpAddress;
            model.Method     = context.Request.Method;
            model.Date       = DateTime.Now;
            model.Path       = context.Request.Path.Value;
            model.UserName   = context.GetIdentityName();
            model.StatusCode = context.Response.StatusCode;
            return(model);
        }
 public string GetUserName()
 {
     return(_context.GetIdentityName());
 }