diff --git a/Axuno.BackgroundTask.Test/Axuno.BackgroundTask.Tests.csproj b/Axuno.BackgroundTask.Test/Axuno.BackgroundTask.Tests.csproj index e5ff34af..5cd5cb99 100644 --- a/Axuno.BackgroundTask.Test/Axuno.BackgroundTask.Tests.csproj +++ b/Axuno.BackgroundTask.Test/Axuno.BackgroundTask.Tests.csproj @@ -1,27 +1,23 @@  - - - net6.0 - false - enable - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + net8.0 + false + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + \ No newline at end of file diff --git a/Axuno.BackgroundTask/Axuno.BackgroundTask.csproj b/Axuno.BackgroundTask/Axuno.BackgroundTask.csproj index b5b59794..b328d9f2 100644 --- a/Axuno.BackgroundTask/Axuno.BackgroundTask.csproj +++ b/Axuno.BackgroundTask/Axuno.BackgroundTask.csproj @@ -1,26 +1,22 @@  - - - Axuno.BackgroundTask - net6.0 - true - 1591 - enable - - - - - <_Parameter1>$(AssemblyName).Tests - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + Axuno.BackgroundTask + net8.0 + true + 1591 + enable + + + + <_Parameter1>$(AssemblyName).Tests + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + \ No newline at end of file diff --git a/Axuno.Tools.Tests/Axuno.Tools.Tests.csproj b/Axuno.Tools.Tests/Axuno.Tools.Tests.csproj index 131f21c4..7fc7e842 100644 --- a/Axuno.Tools.Tests/Axuno.Tools.Tests.csproj +++ b/Axuno.Tools.Tests/Axuno.Tools.Tests.csproj @@ -1,45 +1,38 @@ - - - net6.0 - enable - enable - false - enable - - - - - - - - - - <_Parameter1>$(AssemblyName).Tests - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + net8.0 + enable + enable + false + enable + + + + + + + + <_Parameter1>$(AssemblyName).Tests + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + \ No newline at end of file diff --git a/Axuno.Tools/Axuno.Tools.csproj b/Axuno.Tools/Axuno.Tools.csproj index aebbfd24..a0e1723b 100644 --- a/Axuno.Tools/Axuno.Tools.csproj +++ b/Axuno.Tools/Axuno.Tools.csproj @@ -1,28 +1,24 @@  - - - Axuno.Tools - net6.0 - latest - enable - true - 1591 - enable - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - <_Parameter1>$(AssemblyName).Tests - - - - + + Axuno.Tools + net8.0 + latest + enable + true + 1591 + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + <_Parameter1>$(AssemblyName).Tests + + + \ No newline at end of file diff --git a/Axuno.Web/Axuno.Web.csproj b/Axuno.Web/Axuno.Web.csproj index 3257a79d..eb630447 100644 --- a/Axuno.Web/Axuno.Web.csproj +++ b/Axuno.Web/Axuno.Web.csproj @@ -1,20 +1,16 @@  - - - Axuno.Web - net6.0 - true - 1591 - enable - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + Axuno.Web + net8.0 + true + 1591 + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index cf8671c0..6ff2cb13 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,9 +7,9 @@ Copyright 2011-$(CurrentYear) axuno gGmbH https://github.com/axuno/Volleyball-League true - 6.8.0 - 6.8.0 - 6.0.0.0 + 7.0.0 + 7.0.0 + 7.0.0.0 latest enable true diff --git a/League.Demo/League.Demo.csproj b/League.Demo/League.Demo.csproj index af07183c..32c1ecad 100644 --- a/League.Demo/League.Demo.csproj +++ b/League.Demo/League.Demo.csproj @@ -1,55 +1,47 @@ - - - League.Demo - net6.0 - en - - en;de - enable - - - - - - - - - - - - - - - - - - ViewNames.tt - True - True - - - - - - true - PreserveNewest - - - true - PreserveNewest - - - - - - ViewNames.cs - TextTemplatingFileGenerator - - - - - - - - + + League.Demo + net8.0 + en + + en;de + enable + $(NoWarn);NETSDK1206 + + + + + + + + + + + + + + ViewNames.tt + True + True + + + + + true + PreserveNewest + + + true + PreserveNewest + + + + + ViewNames.cs + TextTemplatingFileGenerator + + + + + + \ No newline at end of file diff --git a/League.Tests/Identity/UserStoreTests.cs b/League.Tests/Identity/UserStoreTests.cs index 46784289..f5b51de6 100644 --- a/League.Tests/Identity/UserStoreTests.cs +++ b/League.Tests/Identity/UserStoreTests.cs @@ -235,9 +235,9 @@ public async Task FindUser() Assert.That(await _store.GetUserIdAsync(user, CancellationToken.None), Is.EqualTo(user.Id.ToString())); Assert.That(await _store.GetUserNameAsync(user, CancellationToken.None), Is.EqualTo(user.UserName)); - Assert.That(await _store.GetNormalizedUserNameAsync(user, CancellationToken.None), Is.EqualTo(user.UserName.ToUpperInvariant())); + Assert.That(await _store.GetNormalizedUserNameAsync(user, CancellationToken.None), Is.EqualTo(user.UserName?.ToUpperInvariant())); - Assert.That(await _store.GetNormalizedEmailAsync(user, CancellationToken.None), Is.EqualTo(user.Email.ToUpperInvariant())); + Assert.That(await _store.GetNormalizedEmailAsync(user, CancellationToken.None), Is.EqualTo(user.Email?.ToUpperInvariant())); }); } diff --git a/League.Tests/League.Tests.csproj b/League.Tests/League.Tests.csproj index b5efc8fb..4725fed3 100644 --- a/League.Tests/League.Tests.csproj +++ b/League.Tests/League.Tests.csproj @@ -1,35 +1,34 @@  - - - net6.0 - enable - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - + + net8.0 + enable + $(NoWarn);NETSDK1206 + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + \ No newline at end of file diff --git a/League.sln b/League.sln index 4b9aad94..8ac14122 100644 --- a/League.sln +++ b/League.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32014.148 @@ -25,7 +25,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TournamentManager.Tests", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "League.Demo", "League.Demo\League.Demo.csproj", "{D44B54A5-FBDC-4446-BB94-901DA3FB4DA2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Axuno.Tools.Tests", "Axuno.Tools.Tests\Axuno.Tools.Tests.csproj", "{247EDA91-EAE4-4580-9C26-E6C3AB91C2D9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Axuno.Tools.Tests", "Axuno.Tools.Tests\Axuno.Tools.Tests.csproj", "{247EDA91-EAE4-4580-9C26-E6C3AB91C2D9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/League/Areas/Admin/Controllers/Impersonation.cs b/League/Areas/Admin/Controllers/Impersonation.cs index f03863d7..f7e80ad4 100644 --- a/League/Areas/Admin/Controllers/Impersonation.cs +++ b/League/Areas/Admin/Controllers/Impersonation.cs @@ -79,7 +79,10 @@ public async Task Stop() if (originalUserId != null) { var appUser = await _signInManager.UserManager.FindByIdAsync(originalUserId); - await _signInManager.SignInAsync(appUser, true); + if (appUser != null) + await _signInManager.SignInAsync(appUser, true); + else + await _signInManager.SignOutAsync(); } else { diff --git a/League/Controllers/Account.cs b/League/Controllers/Account.cs index c6cea74b..334b8448 100644 --- a/League/Controllers/Account.cs +++ b/League/Controllers/Account.cs @@ -138,7 +138,7 @@ public async Task SignIn(SignInViewModel model, string? returnUrl return View(model); } - var result = await _signInManager.PasswordSignInAsync(user.UserName, model.Password, model.RememberMe, lockoutOnFailure: true); + var result = await _signInManager.PasswordSignInAsync(user.UserName ?? string.Empty, model.Password, model.RememberMe, lockoutOnFailure: true); if (result.Succeeded) { @@ -194,7 +194,7 @@ public async Task CreateAccount(CreateAccountViewModel model, str ModelState.AddModelError(nameof(CreateAccountViewModel.Captcha), _localizer["Math task result was incorrect"].Value); } - if (await _signInManager.UserManager.FindByEmailAsync(model.Email) != null) + if (model.Email == null || await _signInManager.UserManager.FindByEmailAsync(model.Email) != null) { ModelState.AddModelError(nameof(CreateAccountViewModel.Email), _localizer["This email is not available for a new account"].Value); } @@ -269,7 +269,7 @@ public async Task Register(RegisterViewModel model, CancellationT PhoneNumberConfirmed = false }; - var result = await _signInManager.UserManager.CreateAsync(user, model.Password); + var result = await _signInManager.UserManager.CreateAsync(user, model.Password!); if (result.Succeeded) { @@ -424,10 +424,9 @@ public async Task ForgotPassword(ForgotPasswordViewModel model) if (model.EmailOrUsername != null && model.EmailOrUsername.Contains('@')) { user = await _signInManager.UserManager.FindByEmailAsync(model.EmailOrUsername); + user ??= await _signInManager.UserManager.FindByNameAsync(model.EmailOrUsername); } - - user ??= await _signInManager.UserManager.FindByNameAsync(model.EmailOrUsername); - + if (user == null || (!await _signInManager.UserManager.IsEmailConfirmedAsync(user) && _signInManager.UserManager.Options.SignIn.RequireConfirmedEmail)) { _logger.LogInformation("No account found for '{User}'.", model.EmailOrUsername); @@ -472,10 +471,9 @@ public async Task ResetPassword(ResetPasswordViewModel model) if (model.EmailOrUsername != null && model.EmailOrUsername.Contains('@')) { user = await _signInManager.UserManager.FindByEmailAsync(model.EmailOrUsername); + user ??= await _signInManager.UserManager.FindByNameAsync(model.EmailOrUsername); } - - user ??= await _signInManager.UserManager.FindByNameAsync(model.EmailOrUsername); - + if (user == null) { _logger.LogInformation("No account found for '{User}'.", model.EmailOrUsername); @@ -483,7 +481,7 @@ public async Task ResetPassword(ResetPasswordViewModel model) await Task.Delay(5000); return View(); } - var result = await _signInManager.UserManager.ResetPasswordAsync(user, model.Code.Base64UrlDecode(), model.Password); + var result = await _signInManager.UserManager.ResetPasswordAsync(user, model.Code.Base64UrlDecode() ?? string.Empty, model.Password ?? string.Empty); if (result.Succeeded) { return Redirect(TenantLink.Action(nameof(Message), nameof(Account), new { messageTypeText = MessageType.PasswordChanged })!); @@ -546,7 +544,8 @@ private async Task IsExternalLoginStoredAsync(ExternalLoginInfo info) { if (User.Identity?.IsAuthenticated ?? false) { - return await _signInManager.UserManager.FindByNameAsync(User.Identity.Name); + if (User.Identity.Name != null) + return await _signInManager.UserManager.FindByNameAsync(User.Identity.Name); } var allExternalEmails = info.Principal.FindAll(ClaimTypes.Email).Select(ct => ct.Value); @@ -574,7 +573,7 @@ private static ExternalSignConfirmationViewModel CreateExternalSignInConfirmatio { return new ExternalSignConfirmationViewModel { - Email = principal.FindFirstValue(ClaimTypes.Email), + Email = principal.FindFirstValue(ClaimTypes.Email) ?? string.Empty, Gender = string.Empty, FirstName = principal.FindFirstValue(ClaimTypes.GivenName) ?? string.Empty, LastName = principal.FindFirstValue(ClaimTypes.Surname) ?? string.Empty @@ -639,6 +638,12 @@ private async Task UpdateUserFromExternalLogin(ApplicationUser user, ExternalLog /// The of the email. private async Task SendCodeByEmail(ApplicationUser user, EmailPurpose purpose) { + if (user.Email is null) + { + _logger.LogCritical("Unexpected missing Email for user {user}", user); + return; + } + string code; var deadline = DateTime.UtcNow.Add(_dataProtectionTokenProviderOptions.Value.TokenLifespan); // round down to full hours diff --git a/League/Controllers/Captcha.cs b/League/Controllers/Captcha.cs index 6a012bbb..2aac952b 100644 --- a/League/Controllers/Captcha.cs +++ b/League/Controllers/Captcha.cs @@ -25,9 +25,9 @@ private Task GetSvgContent() // Change the response headers to output an un-cached image. HttpContext.Response.Clear(); - HttpContext.Response.Headers.Add("Expires", DateTime.UtcNow.Date.AddDays(-1).ToString("R")); - HttpContext.Response.Headers.Add("Cache-Control", "no-store, no-cache, must-revalidate"); - HttpContext.Response.Headers.Add("Pragma", "no-cache"); + HttpContext.Response.Headers.Append("Expires", DateTime.UtcNow.Date.AddDays(-1).ToString("R")); + HttpContext.Response.Headers.Append("Cache-Control", "no-store, no-cache, must-revalidate"); + HttpContext.Response.Headers.Append("Pragma", "no-cache"); HttpContext.Response.ContentType = "image/svg+xml"; return Task.FromResult(Content(ci.Image)); diff --git a/League/Controllers/Manage.cs b/League/Controllers/Manage.cs index 30505ad2..0a53bd63 100644 --- a/League/Controllers/Manage.cs +++ b/League/Controllers/Manage.cs @@ -76,7 +76,7 @@ public async Task Index() ManageMessage = TempData.Get(nameof(ManageMessage)) }; // Display phone numbers in the format of the current region - model.ApplicationUser.PhoneNumber = _phoneNumberService.Format(model.ApplicationUser.PhoneNumber, + model.ApplicationUser.PhoneNumber = _phoneNumberService.Format(model.ApplicationUser.PhoneNumber ?? string.Empty, _regionInfo.TwoLetterISORegionName); model.ApplicationUser.PhoneNumber2 = _phoneNumberService.Format(model.ApplicationUser.PhoneNumber2, _regionInfo.TwoLetterISORegionName); @@ -195,7 +195,7 @@ public async Task ConfirmNewPrimaryEmail(string id, string code, } // ChangeEmailAsync also sets EmailConfirmed = true - var result = await _userManager.ChangeEmailAsync(user, e.Base64UrlDecode(), code.Base64UrlDecode()); + var result = await _userManager.ChangeEmailAsync(user, e.Base64UrlDecode()!, code.Base64UrlDecode()!); if (result != IdentityResult.Success) { TempData.Put(nameof(ManageMessage), new ManageMessage { AlertType = SiteAlertTagHelper.AlertType.Danger, MessageId = MessageId.ChangeEmailFailure }); @@ -287,7 +287,7 @@ public async Task ChangePassword(ChangePasswordViewModel model) return PartialView(ViewNames.Manage._ChangePasswordModalPartial, model); } var user = await GetCurrentUserAsync(); - if (user != null) + if (user != null && model is { CurrentPassword: not null, NewPassword: not null }) { if (!await _userManager.CheckPasswordAsync(user, model.CurrentPassword)) { @@ -328,7 +328,7 @@ public async Task SetPassword(SetPasswordViewModel model) } var user = await GetCurrentUserAsync(); - if (user != null) + if (user != null && model.NewPassword != null) { var result = await _userManager.AddPasswordAsync(user, model.NewPassword); if (result.Succeeded) diff --git a/League/Controllers/Ranking.cs b/League/Controllers/Ranking.cs index 56d6fdf0..0054951b 100644 --- a/League/Controllers/Ranking.cs +++ b/League/Controllers/Ranking.cs @@ -121,7 +121,7 @@ public async Task AllTimeTeam(long? id, CancellationToken cancell private async Task> GetRankingListCached(CancellationToken cancellationToken) { - return await _memoryCache.GetOrCreateAsync( + var rankingList = await _memoryCache.GetOrCreateAsync( string.Join("_", _tenantContext.Identifier, typeof(Ranking).FullName, nameof(RankingListRow)), cache => { @@ -134,11 +134,16 @@ private async Task> GetRankingListCached(CancellationToken cancellationToken); } ); + + if (rankingList != null) return rankingList; + + _logger.LogCritical("Could not get or create round leg periods"); + return new List(); } private async Task> GetRoundLegPeriodsCached(List rankingList, CancellationToken cancellationToken) { - return await _memoryCache.GetOrCreateAsync( + var roundLegPeriods = await _memoryCache.GetOrCreateAsync( string.Join("_", _tenantContext.Identifier, typeof(Ranking).FullName, nameof(RoundLegPeriodRow)), cache => { @@ -152,6 +157,10 @@ private async Task> GetRoundLegPeriodsCached(List(); } private Dictionary GetChartFileInfos(IEnumerable roundIds) diff --git a/League/Controllers/Role.cs b/League/Controllers/Role.cs index b5de950d..031e7fa9 100644 --- a/League/Controllers/Role.cs +++ b/League/Controllers/Role.cs @@ -146,7 +146,7 @@ public async Task Add([FromForm] RoleAddModel model, Cancellation new { model.ReturnUrl })); } - var newTeamMember = await _signInManager.UserManager.FindByEmailAsync(model.UserEmail); + var newTeamMember = model.UserEmail != null ? await _signInManager.UserManager.FindByEmailAsync(model.UserEmail) : null; if (newTeamMember != null) { await _signInManager.UserManager.AddClaimAsync(newTeamMember, new Claim(model.ClaimType, model.TeamId.ToString())); diff --git a/League/Controllers/Team.cs b/League/Controllers/Team.cs index 916e2c5d..2fbf80a7 100644 --- a/League/Controllers/Team.cs +++ b/League/Controllers/Team.cs @@ -71,7 +71,14 @@ public async Task List(CancellationToken cancellationToken) public async Task MyTeam(long? id, CancellationToken cancellationToken) { // make sure that any changes are immediately reflected in the user's application cookie - await _signInManager.RefreshSignInAsync(await _signInManager.UserManager.FindByIdAsync(User.FindFirstValue(ClaimTypes.NameIdentifier))); + var appUser = await _signInManager.UserManager.GetUserAsync(User); + if (appUser != null) + await _signInManager.RefreshSignInAsync(appUser); + else + { + await _signInManager.SignOutAsync(); + return Redirect(TenantLink.Action(nameof(MyTeam), nameof(Team), new { id = default(long?) })!); + } var userTeamIds = GetUserClaimTeamIds(); // As admin, any selected team will be returned as "my team" diff --git a/League/Controllers/TeamApplication.cs b/League/Controllers/TeamApplication.cs index 9fd96d75..6c52e8b1 100644 --- a/League/Controllers/TeamApplication.cs +++ b/League/Controllers/TeamApplication.cs @@ -767,6 +767,11 @@ private async Task AddManagerToTeamEntity(TeamEntity teamEntity, CancellationTok } // make sure that any changes are immediately reflected in the user's application cookie - await _signInManager.RefreshSignInAsync(await _signInManager.UserManager.FindByIdAsync(User.FindFirstValue(ClaimTypes.NameIdentifier))); + var userName = User.FindFirstValue(ClaimTypes.NameIdentifier); + var appUser = userName != null ? await _signInManager.UserManager.FindByIdAsync(userName) : null; + if (appUser != null) + await _signInManager.RefreshSignInAsync(appUser); + else + await _signInManager.SignOutAsync(); } } diff --git a/League/Identity/ApplicationUser.cs b/League/Identity/ApplicationUser.cs index 183e7e65..82582677 100644 --- a/League/Identity/ApplicationUser.cs +++ b/League/Identity/ApplicationUser.cs @@ -5,7 +5,7 @@ namespace League.Identity; /// Represents a custom user in the AspNetCore Identity system public class ApplicationUser : IdentityUser, IIdentity { - public override string UserName + public override string? UserName { get { @@ -14,7 +14,7 @@ public override string UserName set { - Name = value; + Name = value ?? string.Empty; } } diff --git a/League/Identity/MultilanguageIdentityErrorDescriber.cs b/League/Identity/MultilanguageIdentityErrorDescriber.cs index 9cdbf19d..e70ed9fb 100644 --- a/League/Identity/MultilanguageIdentityErrorDescriber.cs +++ b/League/Identity/MultilanguageIdentityErrorDescriber.cs @@ -63,21 +63,21 @@ public override IdentityError LoginAlreadyAssociated() }; } - public override IdentityError InvalidUserName(string userName) + public override IdentityError InvalidUserName(string? userName) { return new IdentityError { Code = nameof(InvalidUserName), - Description = _localizer[nameof(InvalidUserName), userName] + Description = _localizer[nameof(InvalidUserName), userName ?? string.Empty] }; } - public override IdentityError InvalidEmail(string email) + public override IdentityError InvalidEmail(string? email) { return new IdentityError { Code = nameof(InvalidEmail), - Description = _localizer[nameof(InvalidEmail), email] + Description = _localizer[nameof(InvalidEmail), email ?? string.Empty] }; } @@ -99,12 +99,12 @@ public override IdentityError DuplicateEmail(string email) }; } - public override IdentityError InvalidRoleName(string role) + public override IdentityError InvalidRoleName(string? role) { return new IdentityError { Code = nameof(InvalidRoleName), - Description = _localizer[nameof(InvalidRoleName), role] + Description = _localizer[nameof(InvalidRoleName), role ?? string.Empty] }; } diff --git a/League/Identity/RoleStore.cs b/League/Identity/RoleStore.cs index 9beee7e7..10687eb0 100644 --- a/League/Identity/RoleStore.cs +++ b/League/Identity/RoleStore.cs @@ -141,15 +141,15 @@ public async Task FindByNameAsync(string normalizedRoleName, Ca return new ApplicationRole { Id = roleEntity.Id, Name = roleEntity.Name }; } #nullable enable annotations - public Task GetNormalizedRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken) + public Task GetNormalizedRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken) { if (role == null) throw new ArgumentNullException(nameof(role)); - return Task.FromResult(_keyNormalizer.NormalizeName(role.Name)); + return Task.FromResult(_keyNormalizer.NormalizeName(role.Name)); } - public Task SetNormalizedRoleNameAsync(ApplicationRole role, string normalizedName, CancellationToken cancellationToken) + public Task SetNormalizedRoleNameAsync(ApplicationRole role, string? normalizedName, CancellationToken cancellationToken) { return Task.CompletedTask; } @@ -162,20 +162,21 @@ public Task GetRoleIdAsync(ApplicationRole role, CancellationToken cance return Task.FromResult(role.Id.ToString()); } - public Task GetRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken) + public Task GetRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken) { - if (role == null) - throw new ArgumentNullException(nameof(role)); + ArgumentNullException.ThrowIfNull(role); - return Task.FromResult(role.Name); + return Task.FromResult(role.Name); } - public Task SetRoleNameAsync(ApplicationRole role, string roleName, CancellationToken cancellationToken) + public Task SetRoleNameAsync(ApplicationRole role, string? roleName, CancellationToken cancellationToken) { - if (role == null) - throw new ArgumentNullException(nameof(role)); + ArgumentNullException.ThrowIfNull(role); + + if (string.IsNullOrEmpty(roleName)) + throw new ArgumentNullException(nameof(roleName), @"Null or empty"); - role.Name = roleName ?? throw new ArgumentNullException(nameof(roleName)); + role.Name = roleName; return Task.CompletedTask; } diff --git a/League/Identity/UserStore.cs b/League/Identity/UserStore.cs index eef66e72..a6397c68 100644 --- a/League/Identity/UserStore.cs +++ b/League/Identity/UserStore.cs @@ -148,7 +148,7 @@ public async Task FindByNameAsync(string normalizedUserName, Ca { cancellationToken.ThrowIfCancellationRequested(); if (string.IsNullOrEmpty(normalizedUserName)) - throw new ArgumentNullException(nameof(normalizedUserName), "Null or empty"); + throw new ArgumentNullException(nameof(normalizedUserName), @"Null or empty"); var userEntity = await _appDb.UserRepository.GetLoginUserByUserNameAsync(normalizedUserName, cancellationToken); if (userEntity == null) return null; @@ -158,7 +158,7 @@ public async Task FindByNameAsync(string normalizedUserName, Ca return user; } #nullable enable annotations - public Task GetNormalizedUserNameAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetNormalizedUserNameAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -174,7 +174,7 @@ public Task GetUserIdAsync(ApplicationUser user, CancellationToken cance return Task.FromResult(user.Id.ToString()); } - public Task GetUserNameAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetUserNameAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -182,26 +182,26 @@ public Task GetUserNameAsync(ApplicationUser user, CancellationToken can return Task.FromResult(user.UserName); } - public Task SetNormalizedUserNameAsync(ApplicationUser user, string normalizedName, + public Task SetNormalizedUserNameAsync(ApplicationUser user, string? normalizedName, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(normalizedName)) - throw new ArgumentNullException(nameof(normalizedName), "Null or empty"); + throw new ArgumentNullException(nameof(normalizedName), @"Null or empty"); user.NormalizedUserName = _keyNormalizer.NormalizeName(normalizedName); return Task.CompletedTask; } - public Task SetUserNameAsync(ApplicationUser user, string userName, CancellationToken cancellationToken) + public Task SetUserNameAsync(ApplicationUser user, string? userName, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(userName)) - throw new ArgumentNullException(nameof(userName), "Null or empty"); + throw new ArgumentNullException(nameof(userName), @"Null or empty"); user.UserName = userName; SetNormalizedUserNameAsync(user, userName, cancellationToken); @@ -251,13 +251,13 @@ public async Task UpdateAsync(ApplicationUser user, Cancellation #endregion #region ** IUserEmailStore ** - public Task SetEmailAsync(ApplicationUser user, string email, CancellationToken cancellationToken) + public Task SetEmailAsync(ApplicationUser user, string? email, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(email)) - throw new ArgumentNullException(nameof(email), "Null or empty"); + throw new ArgumentNullException(nameof(email), @"Null or empty"); user.Email = email; SetNormalizedEmailAsync(user, email, cancellationToken); @@ -265,7 +265,7 @@ public Task SetEmailAsync(ApplicationUser user, string email, CancellationToken return Task.CompletedTask; } - public Task GetEmailAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetEmailAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -299,7 +299,7 @@ public async Task FindByEmailAsync(string normalizedEmail, Canc cancellationToken.ThrowIfCancellationRequested(); if (string.IsNullOrEmpty(normalizedEmail)) - throw new ArgumentNullException(nameof(normalizedEmail), "Null or empty"); + throw new ArgumentNullException(nameof(normalizedEmail), @"Null or empty"); var userEntity = await _appDb.UserRepository.GetLoginUserByEmailAsync(normalizedEmail, cancellationToken); if (userEntity == null) return null; @@ -309,7 +309,7 @@ public async Task FindByEmailAsync(string normalizedEmail, Canc return user; } #nullable enable annotations - public Task GetNormalizedEmailAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetNormalizedEmailAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -317,14 +317,14 @@ public Task GetNormalizedEmailAsync(ApplicationUser user, CancellationTo return Task.FromResult(user.NormalizedEmail); } - public Task SetNormalizedEmailAsync(ApplicationUser user, string normalizedEmail, + public Task SetNormalizedEmailAsync(ApplicationUser user, string? normalizedEmail, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(normalizedEmail)) - throw new ArgumentNullException(nameof(normalizedEmail), "Null or empty"); + throw new ArgumentNullException(nameof(normalizedEmail), @"Null or empty"); user.NormalizedEmail = _keyNormalizer.NormalizeEmail(normalizedEmail); return Task.CompletedTask; @@ -332,7 +332,7 @@ public Task GetNormalizedEmailAsync(ApplicationUser user, CancellationTo #endregion #region ** IUserPhoneNumberStore ** - public Task SetPhoneNumberAsync(ApplicationUser user, string phoneNumber, CancellationToken cancellationToken) + public Task SetPhoneNumberAsync(ApplicationUser user, string? phoneNumber, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -342,7 +342,7 @@ public Task SetPhoneNumberAsync(ApplicationUser user, string phoneNumber, Cancel return Task.CompletedTask; } - public Task GetPhoneNumberAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetPhoneNumberAsync(ApplicationUser user, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -376,7 +376,7 @@ public Task GetPhoneNumberConfirmedAsync(ApplicationUser user, Cancellatio #endregion #region ** IUserPasswordStore ** - public Task SetPasswordHashAsync(ApplicationUser user, string passwordHash, CancellationToken cancellationToken) + public Task SetPasswordHashAsync(ApplicationUser user, string? passwordHash, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); @@ -410,7 +410,7 @@ public async Task AddToRoleAsync(ApplicationUser user, string roleName, Cancella throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(roleName)) - throw new ArgumentNullException(nameof(roleName), "Null or empty"); + throw new ArgumentNullException(nameof(roleName), @"Null or empty"); if (Constants.RoleName.GetTeamRelatedRoles().Contains(roleName)) { @@ -445,7 +445,7 @@ public async Task RemoveFromRoleAsync(ApplicationUser user, string roleName, Can throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(roleName)) - throw new ArgumentNullException(nameof(roleName), "Null or empty"); + throw new ArgumentNullException(nameof(roleName), @"Null or empty"); if (Constants.RoleName.GetTeamRelatedRoles().Contains(roleName)) { @@ -508,7 +508,7 @@ public async Task> GetRolesAsync(ApplicationUser user, Cancellatio throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(roleName)) - throw new ArgumentNullException(nameof(roleName), "Null or empty"); + throw new ArgumentNullException(nameof(roleName), @"Null or empty"); var roles = await GetRolesAsync(user, cancellationToken); return roles.Any(r => r.Equals(roleName, StringComparison.InvariantCultureIgnoreCase)); @@ -827,12 +827,11 @@ public Task SetSecurityStampAsync(ApplicationUser user, string? stamp, Cancellat return Task.CompletedTask; } - public Task GetSecurityStampAsync(ApplicationUser user, CancellationToken cancellationToken) + public Task GetSecurityStampAsync(ApplicationUser user, CancellationToken cancellationToken) { - if (user == null) - throw new ArgumentNullException(nameof(user)); + ArgumentNullException.ThrowIfNull(user); - return Task.FromResult(user.SecurityStamp); + return Task.FromResult(user.SecurityStamp); } #endregion @@ -864,10 +863,10 @@ public async Task RemoveLoginAsync(ApplicationUser user, string loginProvider, s throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(loginProvider)) - throw new ArgumentNullException(nameof(loginProvider), "Null or empty"); + throw new ArgumentNullException(nameof(loginProvider), @"Null or empty"); if (string.IsNullOrEmpty(providerKey)) - throw new ArgumentNullException(nameof(providerKey), "Null or empty"); + throw new ArgumentNullException(nameof(providerKey), @"Null or empty"); try { @@ -900,10 +899,10 @@ public async Task> GetLoginsAsync(ApplicationUser user, Can public async Task FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(loginProvider)) - throw new ArgumentNullException(nameof(loginProvider), "Null or empty"); + throw new ArgumentNullException(nameof(loginProvider), @"Null or empty"); if (string.IsNullOrEmpty(providerKey)) - throw new ArgumentNullException(nameof(providerKey), "Null or empty"); + throw new ArgumentNullException(nameof(providerKey), @"Null or empty"); var userEntity = await _appDb.UserLoginRepository.GetUserByLoginAsync(loginProvider, providerKey, cancellationToken); if (userEntity == null) return null; @@ -922,29 +921,29 @@ public async Task FindByLoginAsync(string loginProvider, string throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(loginProvider)) - throw new ArgumentNullException(nameof(loginProvider), "Null or empty"); + throw new ArgumentNullException(nameof(loginProvider), @"Null or empty"); if (string.IsNullOrEmpty(name)) - throw new ArgumentNullException(nameof(name), "Null or empty"); + throw new ArgumentNullException(nameof(name), @"Null or empty"); var userTokenEntity = await _appDb.UserTokenRepository.GetTokenAsync(user.Id, loginProvider, name, cancellationToken); return userTokenEntity?.Value; } - public async Task SetTokenAsync(ApplicationUser user, string loginProvider, string name, string value, + public async Task SetTokenAsync(ApplicationUser user, string loginProvider, string name, string? value, CancellationToken cancellationToken) { if (user == null) throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(loginProvider)) - throw new ArgumentNullException(nameof(loginProvider), "Null or empty"); + throw new ArgumentNullException(nameof(loginProvider), @"Null or empty"); if (string.IsNullOrEmpty(name)) - throw new ArgumentNullException(nameof(name), "Null or empty"); + throw new ArgumentNullException(nameof(name), @"Null or empty"); if (string.IsNullOrEmpty(value)) - throw new ArgumentNullException(nameof(value), "Null or empty"); + throw new ArgumentNullException(nameof(value), @"Null or empty"); try { @@ -970,10 +969,10 @@ public async Task RemoveTokenAsync(ApplicationUser user, string loginProvider, s throw new ArgumentNullException(nameof(user)); if (string.IsNullOrEmpty(loginProvider)) - throw new ArgumentNullException(nameof(loginProvider), "Null or empty"); + throw new ArgumentNullException(nameof(loginProvider), @"Null or empty"); if (string.IsNullOrEmpty(name)) - throw new ArgumentNullException(nameof(name), "Null or empty"); + throw new ArgumentNullException(nameof(name), @"Null or empty"); var msg = $"AuthenticationToken with name '{name}' for provider '{loginProvider}' and user id '{user.Id}' could not be removed"; try diff --git a/League/League.csproj b/League/League.csproj index a1a250ad..9b62a3a6 100644 --- a/League/League.csproj +++ b/League/League.csproj @@ -1,275 +1,260 @@  - - - Volleyball-League - net6.0 - League - League - ceea2bf6-8147-49b9-be85-26fca01f9ed3 - en - Volleyball-League - Volleyball League is an open source sports platform that brings everything necessary to organize and to run a league. + + Volleyball-League + net8.0 + League + League + ceea2bf6-8147-49b9-be85-26fca01f9ed3 + en + Volleyball-League + Volleyball League is an open source sports platform that brings everything necessary to organize and to run a league. Localizations for English and German are included. The library is in operation on platform https://volleyball-liga.de/ - MIT - https://github.com/axuno/Volleyball-League - Git - competition platform league asp-net sport volleyball net60 - - true - true - false - true - - en;de - enable - - $(NoWarn);AD0001 - - - - true - - / - - - - bin\Release\ - 3 - true - true - true - true - true - true - portable - true - DEBUG;TRACE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - true - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Never - - - - - - True - True - StatusCodes.resx - - - True - True - StatusDescriptions.resx - - - True - True - DataAnnotationResource.resx - - - True - True - ModelBindingMessageResource.resx - - - True - True - EmailResource.resx - - - _AddMemberModalPartial.resx - True - True - - - True - True - _AddMemberModalPartial.resx - - - True - True - _RemoveMemberModalPartial.resx - - - _TeamApplicationMessagesPartial.resx - True - True - - - True - True - _MyTeamMessagesPartial.resx - - - True - True - ViewNames.tt - - - - - - TextTemplatingFileGenerator - ViewNames.cs - - - - - - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - StatusCodes.Designer.cs - - - PublicResXFileCodeGenerator - StatusDescriptions.Designer.cs - - - PublicResXFileCodeGenerator - DataAnnotationResource.Designer.cs - - - PublicResXFileCodeGenerator - ModelBindingMessageResource.Designer.cs - - - PublicResXFileCodeGenerator - EmailResource.Designer.cs - - - _RemoveMemberModalPartial.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - _AddMemberModalPartial.Designer.cs - - - _TeamApplicationMessagesPartial.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - _MyTeamMessagesPartial.Designer.cs - - - - - - - - - - - - - - - - - - - ES5 - React - AMD - True - False - False - - - False - True - True - - - - - - - Development - - - Production - - + MIT + https://github.com/axuno/Volleyball-League + Git + competition platform league asp-net sport volleyball net60 + + + true + true + false + true + + en;de + enable + + $(NoWarn);AD0001;NETSDK1206 + + + true + + / + + + bin\Release\ + 3 + true + true + true + true + true + true + portable + true + DEBUG;TRACE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + true + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Never + + + + + True + True + StatusCodes.resx + + + True + True + StatusDescriptions.resx + + + True + True + DataAnnotationResource.resx + + + True + True + ModelBindingMessageResource.resx + + + True + True + EmailResource.resx + + + _AddMemberModalPartial.resx + True + True + + + True + True + _AddMemberModalPartial.resx + + + True + True + _RemoveMemberModalPartial.resx + + + _TeamApplicationMessagesPartial.resx + True + True + + + True + True + _MyTeamMessagesPartial.resx + + + True + True + ViewNames.tt + + + + + TextTemplatingFileGenerator + ViewNames.cs + + + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + StatusCodes.Designer.cs + + + PublicResXFileCodeGenerator + StatusDescriptions.Designer.cs + + + PublicResXFileCodeGenerator + DataAnnotationResource.Designer.cs + + + PublicResXFileCodeGenerator + ModelBindingMessageResource.Designer.cs + + + PublicResXFileCodeGenerator + EmailResource.Designer.cs + + + _RemoveMemberModalPartial.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + _AddMemberModalPartial.Designer.cs + + + _TeamApplicationMessagesPartial.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + _MyTeamMessagesPartial.Designer.cs + + + + + + + + + + + + + + + ES5 + React + AMD + True + False + False + + + False + True + True + + + + + + Development + + + Production + + \ No newline at end of file diff --git a/League/Models/ManageViewModels/RemoveLoginViewModel.cs b/League/Models/ManageViewModels/RemoveLoginViewModel.cs index 01e1a4e2..c1d04324 100644 --- a/League/Models/ManageViewModels/RemoveLoginViewModel.cs +++ b/League/Models/ManageViewModels/RemoveLoginViewModel.cs @@ -3,6 +3,6 @@ namespace League.Models.ManageViewModels; public class RemoveLoginViewModel { - public string? LoginProvider { get; set; } - public string? ProviderKey { get; set; } + public string LoginProvider { get; set; } = string.Empty; + public string ProviderKey { get; set; } = string.Empty; } diff --git a/TournamentManager/DAL/DatabaseGeneric/TournamentManager.DAL.DbGeneric.csproj b/TournamentManager/DAL/DatabaseGeneric/TournamentManager.DAL.DbGeneric.csproj index 145fa918..4685603c 100644 --- a/TournamentManager/DAL/DatabaseGeneric/TournamentManager.DAL.DbGeneric.csproj +++ b/TournamentManager/DAL/DatabaseGeneric/TournamentManager.DAL.DbGeneric.csproj @@ -1,17 +1,17 @@  - - net6.0 - TournamentManager.DAL.DbGeneric - TournamentManager.DAL - true - CA5362;CS1591 - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + net8.0 + TournamentManager.DAL.DbGeneric + TournamentManager.DAL + true + CA5362;CS1591 + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + \ No newline at end of file diff --git a/TournamentManager/DAL/DatabaseSpecific/TournamentManager.DAL.DBSpecific.csproj b/TournamentManager/DAL/DatabaseSpecific/TournamentManager.DAL.DBSpecific.csproj index fa13c7a6..cba29670 100644 --- a/TournamentManager/DAL/DatabaseSpecific/TournamentManager.DAL.DBSpecific.csproj +++ b/TournamentManager/DAL/DatabaseSpecific/TournamentManager.DAL.DBSpecific.csproj @@ -1,16 +1,16 @@  - - net6.0 - TournamentManager.DAL.DBSpecific - TournamentManager.DAL.DatabaseSpecific - true - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + net8.0 + TournamentManager.DAL.DBSpecific + TournamentManager.DAL.DatabaseSpecific + true + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + \ No newline at end of file diff --git a/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantConfigWatcherTests.cs b/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantConfigWatcherTests.cs index 81896350..68f6eabc 100644 --- a/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantConfigWatcherTests.cs +++ b/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantConfigWatcherTests.cs @@ -135,8 +135,8 @@ private TenantConfigWatcher GetTenantConfigWatcher() private IConfiguration CreateTenantStoreConfig() { // Configure connection strings per tenant - var connStr = new List>(); - _tenantNames.ForEach(t => connStr.Add(new KeyValuePair($"{ConnectionStrings}:{ConnKeyPrefix}{t}", $"{ConnValuePrefix}{t}"))); + var connStr = new List>(); + _tenantNames.ForEach(t => connStr.Add(new KeyValuePair($"{ConnectionStrings}:{ConnKeyPrefix}{t}", $"{ConnValuePrefix}{t}"))); // Build configuration var cb = new ConfigurationBuilder(); cb.AddInMemoryCollection(connStr); diff --git a/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantStoreTests.cs b/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantStoreTests.cs index 514223dc..51b90871 100644 --- a/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantStoreTests.cs +++ b/TournamentManager/TournamentManager.Tests/MultiTenancy/TenantStoreTests.cs @@ -18,8 +18,8 @@ public class TenantStoreTests public TenantStoreTests() { // Configure connection strings per tenant - var connStr = new List>(); - _tenantNames.ForEach(t => connStr.Add(new KeyValuePair($"{ConnectionStrings}:{ConnKeyPrefix}{t}", $"{ConnValuePrefix}{t}"))); + var connStr = new List>(); + _tenantNames.ForEach(t => connStr.Add(new KeyValuePair($"{ConnectionStrings}:{ConnKeyPrefix}{t}", $"{ConnValuePrefix}{t}"))); // Build configuration var cb = new ConfigurationBuilder(); cb.AddInMemoryCollection(connStr); diff --git a/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLogger.cs b/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLogger.cs index f53c0e37..4420c39e 100644 --- a/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLogger.cs +++ b/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLogger.cs @@ -97,7 +97,7 @@ public bool IsEnabled(LogLevel logLevel) /// /// /// Returns the instance of this logger. - public IDisposable BeginScope(TState state) + public IDisposable BeginScope(TState state) where TState : notnull { return this; } diff --git a/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLoggerOfT.cs b/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLoggerOfT.cs index 40d7b4c9..8b1d9d3f 100644 --- a/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLoggerOfT.cs +++ b/TournamentManager/TournamentManager.Tests/TestComponents/NUnitLoggerOfT.cs @@ -15,9 +15,9 @@ public NUnitLogger() : base(typeof(T).FullName ?? "(null)") { } /// - /// Gets a new instance of an . + /// Gets a new instance of a . /// - /// Returns a new instance of an . + /// Returns a new instance of a . public new ILogger Create() { return new NUnitLogger(); diff --git a/TournamentManager/TournamentManager.Tests/TournamentManager.Tests.csproj b/TournamentManager/TournamentManager.Tests/TournamentManager.Tests.csproj index d9ab9646..0ea9c836 100644 --- a/TournamentManager/TournamentManager.Tests/TournamentManager.Tests.csproj +++ b/TournamentManager/TournamentManager.Tests/TournamentManager.Tests.csproj @@ -1,38 +1,35 @@  - - - net6.0 - en - enable - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - + + net8.0 + en + enable + $(NoWarn);NETSDK1206 + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + \ No newline at end of file diff --git a/TournamentManager/TournamentManager/Data/UserRepository.cs b/TournamentManager/TournamentManager/Data/UserRepository.cs index 6d4ecf37..a06dd685 100644 --- a/TournamentManager/TournamentManager/Data/UserRepository.cs +++ b/TournamentManager/TournamentManager/Data/UserRepository.cs @@ -137,8 +137,10 @@ where username.Equals(u.UserName, StringComparison.InvariantCultureIgnoreCase) /// /// /// Returns true, if a user with the given email exists, else false. - public virtual async Task EmailExistsAsync(string email) + public virtual async Task EmailExistsAsync(string? email) { + if (email == null) return false; + email = email.ToLowerInvariant(); using var da = _dbContext.GetNewAdapter(); var metaData = new LinqMetaData(da); diff --git a/TournamentManager/TournamentManager/TournamentManager.csproj b/TournamentManager/TournamentManager/TournamentManager.csproj index 817b9450..a9ccecf4 100644 --- a/TournamentManager/TournamentManager/TournamentManager.csproj +++ b/TournamentManager/TournamentManager/TournamentManager.csproj @@ -1,170 +1,162 @@  - - - Tournament Manager - net6.0 - en - - en;de - 6.2.0 - 6.2.0 - true - 1591 - TournamentManager is the backend for Volleyball League. + + Tournament Manager + net8.0 + en + + en;de + 6.2.0 + 6.2.0 + true + $(NoWarn);1591;NETSDK1206 + TournamentManager is the backend for Volleyball League. Volleyball League is an open source sports platform that brings everything necessary to organize and to run a league. - - en;de - enable - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - Development - - - Production - - - - - True - True - FixtureValidatorResource.resx - - - True - True - UserEntityValidatorResource.resx - - - True - True - MatchResultPermissionValidatorResource.resx - - - True - True - MatchResultValidatorResource.resx - - - True - True - PhoneNumberValidatorResource.resx - - - True - True - SetsValidatorResource.resx - - - True - True - SingleSetValidatorResource.resx - - - True - True - TeamInRoundValidatorResource.resx - - - True - True - TeamValidatorResource.resx - - - True - True - TeamVenueValidatorResource.resx - - - True - True - VenueValidatorResource.resx - - - - - - ResXFileCodeGenerator - FixtureValidatorResource.Designer.cs - - - PublicResXFileCodeGenerator - UserEntityValidatorResource.Designer.cs - - - ResXFileCodeGenerator - MatchResultPermissionValidatorResource.Designer.cs - - - ResXFileCodeGenerator - MatchResultValidatorResource.Designer.cs - - - ResXFileCodeGenerator - PhoneNumberValidatorResource.Designer.cs - - - ResXFileCodeGenerator - SetsValidatorResource.Designer.cs - - - ResXFileCodeGenerator - SingleSetValidatorResource.Designer.cs - - - TeamInRoundValidatorResource.Designer.cs - ResXFileCodeGenerator - - - ResXFileCodeGenerator - TeamVenueValidatorResource.Designer.cs - - - VenueValidatorResource.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - TeamValidatorResource.Designer.cs - - - - - - <_Parameter1>$(AssemblyName).Tests - - - <_Parameter1>$(AssemblyName).Play - - - - <_Parameter1>DynamicProxyGenAssembly2 - - - - + + en;de + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + Development + + + Production + + + + True + True + FixtureValidatorResource.resx + + + True + True + UserEntityValidatorResource.resx + + + True + True + MatchResultPermissionValidatorResource.resx + + + True + True + MatchResultValidatorResource.resx + + + True + True + PhoneNumberValidatorResource.resx + + + True + True + SetsValidatorResource.resx + + + True + True + SingleSetValidatorResource.resx + + + True + True + TeamInRoundValidatorResource.resx + + + True + True + TeamValidatorResource.resx + + + True + True + TeamVenueValidatorResource.resx + + + True + True + VenueValidatorResource.resx + + + + + ResXFileCodeGenerator + FixtureValidatorResource.Designer.cs + + + PublicResXFileCodeGenerator + UserEntityValidatorResource.Designer.cs + + + ResXFileCodeGenerator + MatchResultPermissionValidatorResource.Designer.cs + + + ResXFileCodeGenerator + MatchResultValidatorResource.Designer.cs + + + ResXFileCodeGenerator + PhoneNumberValidatorResource.Designer.cs + + + ResXFileCodeGenerator + SetsValidatorResource.Designer.cs + + + ResXFileCodeGenerator + SingleSetValidatorResource.Designer.cs + + + TeamInRoundValidatorResource.Designer.cs + ResXFileCodeGenerator + + + ResXFileCodeGenerator + TeamVenueValidatorResource.Designer.cs + + + VenueValidatorResource.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + TeamValidatorResource.Designer.cs + + + + + <_Parameter1>$(AssemblyName).Tests + + + <_Parameter1>$(AssemblyName).Play + + + + <_Parameter1>DynamicProxyGenAssembly2 + + + \ No newline at end of file