public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { var webCtx = context.WebContext; Guid?loginId = null; if (login != null) { loginId = login.Id; if (userName == null) { userName = login.UserName; } } else if (context.User.Kind == UserKind.AuthenticatedUser) { loginId = context.User.UserId; //most likely the same if (userName == null) { userName = context.User.UserName; } } var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName); _backgroundSave.AddObject(logEntry); }
public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { var webCtx = context.WebContext; Guid? loginId = null; if(login != null) { loginId = login.Id; if(userName == null) userName = login.UserName; } var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName); _backgroundSave.AddObject(logEntry); }