コード例 #1
0
        private GitUserDto GetGitUser(string username)
        {
            var user       = new GitUserDto();
            var userResult = GitService.GetGitUser(new GetGitUserRequest(username));

            if (userResult.IsNull() || userResult.User.IsNull())
            {
                Logger.Error("The user returned by the git service was null. Username - {0}".FormatInvariantCulture(username));
                Notifications.AddError(Errors.GetGitUserError.FormatInvariantCulture(username));
            }

            if (!Notifications.HasErrors())
            {
                user = userResult.User;
            }

            if (!Notifications.HasErrors() && !userResult.IsValid())
            {
                Notifications.AddMessage(new Notification(Messages.NoUserFound.FormatInvariantCulture(username)));
            }

            return(user);
        }