From 2528710897c6995eaa6b04a63c1daa8cdffbf29d Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Fri, 25 Oct 2019 18:36:02 +0800 Subject: Add NeutralResourcesLanguage. Conform to best practices. --- Timeline/Services/UserService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Timeline/Services/UserService.cs') diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs index 8f354fc7..4012539f 100644 --- a/Timeline/Services/UserService.cs +++ b/Timeline/Services/UserService.cs @@ -164,15 +164,15 @@ namespace Timeline.Services _logger.LogInformation(Log.Format(Resources.Services.UserService.LogCacheRemove, ("Key", key))); } - private void CheckUsernameFormat(string username, string? message = null) + private void CheckUsernameFormat(string username, string? additionalMessage = null) { - var (result, messageGenerator) = _usernameValidator.Validate(username); + var (result, message) = _usernameValidator.Validate(username); if (!result) { - if (message == null) - throw new UsernameBadFormatException(username, messageGenerator(null)); + if (additionalMessage == null) + throw new UsernameBadFormatException(username, message); else - throw new UsernameBadFormatException(username, message + messageGenerator(null)); + throw new UsernameBadFormatException(username, additionalMessage + message); } } -- cgit v1.2.3