Browse Source

Merge pull request #17062 from abpframework/liangshiwei/group3

Group3 Enable nullable annotations
pull/17074/head
maliming 3 years ago
committed by GitHub
parent
commit
2fcc39dd7e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj
  2. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj
  3. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpAspNetCoreComponentsMauiBlazorModule.cs
  4. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpMauiBlazorClientHttpMessageHandler.cs
  5. 6
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/ApplicationConfigurationCache.cs
  6. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/IMauiBlazorSelectedLanguageProvider.cs
  7. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorCurrentTenantAccessor.cs
  8. 18
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorRemoteTenantStore.cs
  9. 2
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorServerUrlProvider.cs
  10. 4
      framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/NullMauiBlazorSelectedLanguageProvider.cs
  11. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj
  12. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs
  13. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj
  14. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs
  15. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/DynamicLayoutComponent.razor.cs
  16. 8
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs
  17. 10
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
  18. 12
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs
  19. 16
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs
  20. 5
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarItem.cs
  21. 8
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/SimplePageToolbarContributor.cs
  22. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Routing/AbpRouterOptions.cs
  23. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/AbpThemingOptions.cs
  24. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/DefaultThemeManager.cs
  25. 3
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs
  26. 3
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarConfigurationContext.cs
  27. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarItem.cs
  28. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj
  29. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj
  30. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorClientHttpMessageHandler.cs
  31. 4
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs
  32. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieOptions.cs
  33. 4
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieService.cs
  34. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DefaultServerUrlProvider.cs
  35. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs
  36. 6
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger.cs
  37. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLoggerProvider.cs
  38. 8
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs
  39. 14
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs
  40. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityActionDictionary.cs
  41. 15
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs
  42. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumnDictionary.cs
  43. 4
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ICookieService.cs
  44. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/IServerUrlProvider.cs
  45. 10
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Messages/SimpleUiMessageService.cs
  46. 5
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs
  47. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/ApplicationConfigurationChangedService.cs
  48. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj
  49. 4
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/Extensions/DependencyInjection/EmptyWebAssemblyHostEnvironment.cs
  50. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj
  51. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs
  52. 4
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ApplicationConfigurationCache.cs
  53. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentTenantAccessor.cs
  54. 2
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyServerUrlProvider.cs
  55. 2
      framework/src/Volo.Abp.AspNetCore.Components/Volo.Abp.AspNetCore.Components.csproj
  56. 70
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs
  57. 10
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Alerts/AlertList.cs
  58. 7
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Alerts/AlertMessage.cs
  59. 10
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs
  60. 2
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageEventArgs.cs
  61. 14
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs
  62. 8
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs
  63. 8
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/NullUiNotificationService.cs
  64. 4
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationOptions.cs
  65. 2
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Progression/IUiPageProgressService.cs
  66. 4
      framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Progression/NullUiPageProgressService.cs
  67. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs
  68. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs
  69. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs
  70. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs
  71. 4
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs
  72. 4
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationOptionsManager.cs
  73. 8
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs
  74. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/IAbpRequestLocalizationOptionsProvider.cs
  75. 2
      framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/CookieAuthenticationOptionsExtensions.cs
  76. 12
      framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/EmptyHostingEnvironment.cs
  77. 4
      framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/WebApplicationBuilderExtensions.cs
  78. 2
      framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj
  79. 5
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/ApplicationInitializationContextExtensions.cs
  80. 2
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpAuthorizationExceptionHandlerOptions.cs
  81. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultAbpAuthorizationExceptionHandler.cs
  82. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultHttpExceptionStatusCodeFinder.cs
  83. 6
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs
  84. 2
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersOptions.cs
  85. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs
  86. 6
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AbpFileExtensionContentTypeProvider.cs
  87. 2
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/RazorViewEngineVirtualFileProvider.cs
  88. 8
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/WebClientInfo/HttpContextWebClientInfoProvider.cs
  89. 4
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/WebClientInfo/IWebClientInfoProvider.cs
  90. 3
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/ServiceProviderAccessorExtensions.cs
  91. 4
      framework/src/Volo.Abp.RemoteServices/Volo/Abp/Http/Client/RemoteServiceConfiguration.cs
  92. 4
      framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.AspNetCore.Components.MauiBlazor</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Components.MauiBlazor</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpAspNetCoreComponentsMauiBlazorModule.cs

@ -51,7 +51,7 @@ public class AbpAspNetCoreComponentsMauiBlazorModule : AbpModule
var cultureName = configuration.Localization?.CurrentCulture?.CultureName;
if (!cultureName.IsNullOrEmpty())
{
var culture = new CultureInfo(cultureName);
var culture = new CultureInfo(cultureName!);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpMauiBlazorClientHttpMessageHandler.cs

@ -48,7 +48,7 @@ public class AbpMauiBlazorClientHttpMessageHandler : DelegatingHandler, ITransie
if (!selectedLanguage.IsNullOrWhiteSpace())
{
request.Headers.AcceptLanguage.Clear();
request.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(selectedLanguage));
request.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(selectedLanguage!));
}
}
}

6
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/ApplicationConfigurationCache.cs

@ -7,11 +7,11 @@ namespace Volo.Abp.AspNetCore.Components.MauiBlazor;
public class ApplicationConfigurationCache : ISingletonDependency
{
protected ApplicationConfigurationDto Configuration { get; set; }
protected ApplicationConfigurationDto? Configuration { get; set; }
public event Action ApplicationConfigurationChanged;
public event Action? ApplicationConfigurationChanged;
public virtual ApplicationConfigurationDto Get()
public virtual ApplicationConfigurationDto? Get()
{
return Configuration;
}

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/IMauiBlazorSelectedLanguageProvider.cs

@ -4,5 +4,5 @@ namespace Volo.Abp.AspNetCore.Components.MauiBlazor;
public interface IMauiBlazorSelectedLanguageProvider
{
Task<string> GetSelectedLanguageAsync();
Task<string?> GetSelectedLanguageAsync();
}

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorCurrentTenantAccessor.cs

@ -6,5 +6,5 @@ namespace Volo.Abp.AspNetCore.Components.MauiBlazor;
[Dependency(ReplaceServices = true)]
public class MauiBlazorCurrentTenantAccessor : ICurrentTenantAccessor, ISingletonDependency
{
public BasicTenantInfo Current { get; set; }
public BasicTenantInfo? Current { get; set; }
}

18
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorRemoteTenantStore.cs

@ -23,13 +23,13 @@ public class MauiBlazorRemoteTenantStore : ITenantStore, ITransientDependency
Cache = cache;
}
public async Task<TenantConfiguration> FindAsync(string name)
public async Task<TenantConfiguration?> FindAsync(string name)
{
var cacheKey = CreateCacheKey(name);
var tenantConfiguration = await Cache.GetOrAddAsync(
cacheKey,
async () => CreateTenantConfiguration(await TenantAppService.FindTenantByNameAsync(name)),
async () => CreateTenantConfiguration(await TenantAppService.FindTenantByNameAsync(name))!,
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
@ -40,13 +40,13 @@ public class MauiBlazorRemoteTenantStore : ITenantStore, ITransientDependency
return tenantConfiguration;
}
public async Task<TenantConfiguration> FindAsync(Guid id)
public async Task<TenantConfiguration?> FindAsync(Guid id)
{
var cacheKey = CreateCacheKey(id);
var tenantConfiguration = await Cache.GetOrAddAsync(
cacheKey,
async () => CreateTenantConfiguration(await TenantAppService.FindTenantByIdAsync(id)),
async () => CreateTenantConfiguration(await TenantAppService.FindTenantByIdAsync(id))!,
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
@ -57,13 +57,13 @@ public class MauiBlazorRemoteTenantStore : ITenantStore, ITransientDependency
return tenantConfiguration;
}
public TenantConfiguration Find(string name)
public TenantConfiguration? Find(string name)
{
var cacheKey = CreateCacheKey(name);
var tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await TenantAppService.FindTenantByNameAsync(name))),
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await TenantAppService.FindTenantByNameAsync(name)))!,
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
@ -74,13 +74,13 @@ public class MauiBlazorRemoteTenantStore : ITenantStore, ITransientDependency
return tenantConfiguration;
}
public TenantConfiguration Find(Guid id)
public TenantConfiguration? Find(Guid id)
{
var cacheKey = CreateCacheKey(id);
var tenantConfiguration = Cache.GetOrAdd(
cacheKey,
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await TenantAppService.FindTenantByIdAsync(id))),
() => AsyncHelper.RunSync(async () => CreateTenantConfiguration(await TenantAppService.FindTenantByIdAsync(id)))!,
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =
@ -91,7 +91,7 @@ public class MauiBlazorRemoteTenantStore : ITenantStore, ITransientDependency
return tenantConfiguration;
}
protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto)
protected virtual TenantConfiguration? CreateTenantConfiguration(FindTenantResultDto tenantResultDto)
{
if (!tenantResultDto.Success || tenantResultDto.TenantId == null)
{

2
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorServerUrlProvider.cs

@ -17,7 +17,7 @@ public class MauiBlazorServerUrlProvider : IServerUrlProvider, ITransientDepende
RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
}
public async Task<string> GetBaseUrlAsync(string remoteServiceName = null)
public async Task<string> GetBaseUrlAsync(string? remoteServiceName = null)
{
var remoteServiceConfiguration = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(
remoteServiceName ?? RemoteServiceConfigurationDictionary.DefaultName

4
framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/NullMauiBlazorSelectedLanguageProvider.cs

@ -5,8 +5,8 @@ namespace Volo.Abp.AspNetCore.Components.MauiBlazor;
public class NullMauiBlazorSelectedLanguageProvider : IMauiBlazorSelectedLanguageProvider, ITransientDependency
{
public Task<string> GetSelectedLanguageAsync()
public Task<string?> GetSelectedLanguageAsync()
{
return Task.FromResult((string)null);
return Task.FromResult((string?)null);
}
}

2
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>

2
framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs

@ -33,7 +33,7 @@ public static class CookieAuthenticationOptionsExtensions
var openIdConnectOptions = await GetOpenIdConnectOptions(principalContext, oidcAuthenticationScheme);
var response = await openIdConnectOptions.Backchannel.IntrospectTokenAsync(new TokenIntrospectionRequest
{
Address = openIdConnectOptions.Configuration?.IntrospectionEndpoint ?? openIdConnectOptions.Authority.EnsureEndsWith('/') + "connect/introspect",
Address = openIdConnectOptions.Configuration?.IntrospectionEndpoint ?? openIdConnectOptions.Authority!.EnsureEndsWith('/') + "connect/introspect",
ClientId = openIdConnectOptions.ClientId,
ClientSecret = openIdConnectOptions.ClientSecret,
Token = accessToken

2
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<IsPackable>true</IsPackable>
<OutputType>Library</OutputType>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>

2
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs

@ -62,7 +62,7 @@ public class BlazorServerLookupApiRequestService : ILookupApiRequestService, ITr
{
baseUrl = NavigationManager.BaseUri;
client.BaseAddress = new Uri(baseUrl);
foreach (var header in HttpContextAccessor.HttpContext.Request.Headers)
foreach (var header in HttpContextAccessor.HttpContext!.Request.Headers)
{
requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/DynamicLayoutComponent.razor.cs

@ -6,5 +6,5 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Components;
public partial class DynamicLayoutComponent : ComponentBase
{
[Inject]
protected IOptions<AbpDynamicLayoutComponentOptions> AbpDynamicLayoutComponentOptions { get; set; }
protected IOptions<AbpDynamicLayoutComponentOptions> AbpDynamicLayoutComponentOptions { get; set; } = default!;
}

8
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs

@ -10,15 +10,15 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Components.LayoutHooks;
public partial class LayoutHook : ComponentBase
{
[Parameter]
public string Name { get; set; }
public string Name { get; set; } = default!;
[Parameter]
public string Layout { get; set; }
public string? Layout { get; set; }
[Inject]
protected IOptions<AbpLayoutHookOptions> LayoutHookOptions { get; set; }
protected IOptions<AbpLayoutHookOptions> LayoutHookOptions { get; set; } = default!;
protected LayoutHookViewModel LayoutHookViewModel { get; private set; }
protected LayoutHookViewModel LayoutHookViewModel { get; private set; } = default!;
protected override Task OnInitializedAsync()
{

10
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs

@ -13,13 +13,13 @@ public partial class PageHeader : ComponentBase
{
protected List<RenderFragment> ToolbarItemRenders { get; set; }
public IPageToolbarManager PageToolbarManager { get; set; }
public IPageToolbarManager PageToolbarManager { get; set; } = default!;
[Inject]
public PageLayout PageLayout { get; private set; }
public PageLayout PageLayout { get; private set; } = default!;
[Parameter] // TODO: Consider removing this property in future and use only PageLayout.
public string Title { get => PageLayout.Title; set => PageLayout.Title = value; }
public string? Title { get => PageLayout.Title; set => PageLayout.Title = value; }
[Parameter]
public bool BreadcrumbShowHome { get; set; } = true;
@ -28,7 +28,7 @@ public partial class PageHeader : ComponentBase
public bool BreadcrumbShowCurrent { get; set; } = true;
[Parameter]
public RenderFragment ChildContent { get; set; }
public RenderFragment ChildContent { get; set; } = default!;
[Parameter] // TODO: Consider removing this property in future and use only PageLayout.
public List<BreadcrumbItem> BreadcrumbItems {
@ -44,7 +44,7 @@ public partial class PageHeader : ComponentBase
}
[Parameter]
public PageToolbar Toolbar { get; set; }
public PageToolbar? Toolbar { get; set; }
public PageHeader()
{

12
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs

@ -9,10 +9,10 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout;
public class PageLayout : IScopedDependency, INotifyPropertyChanged
{
private string title;
private string? title;
// TODO: Consider using this property for setting Page Title too.
public virtual string Title {
public virtual string? Title {
get => title;
set {
title = value;
@ -20,9 +20,9 @@ public class PageLayout : IScopedDependency, INotifyPropertyChanged
}
}
private string menuItemName;
private string? menuItemName;
public string MenuItemName {
public string? MenuItemName {
get => menuItemName;
set
{
@ -35,9 +35,9 @@ public class PageLayout : IScopedDependency, INotifyPropertyChanged
public virtual ObservableCollection<PageToolbarItem> ToolbarItems { get; } = new();
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

16
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs

@ -11,9 +11,9 @@ public static class PageToolbarExtensions
{
public static PageToolbar AddComponent<TComponent>(
this PageToolbar toolbar,
Dictionary<string, object> arguments = null,
Dictionary<string, object?>? arguments = null,
int order = 0,
string requiredPolicyName = null)
string? requiredPolicyName = null)
{
return toolbar.AddComponent(
typeof(TComponent),
@ -26,9 +26,9 @@ public static class PageToolbarExtensions
public static PageToolbar AddComponent(
this PageToolbar toolbar,
Type componentType,
Dictionary<string, object> arguments = null,
Dictionary<string, object?>? arguments = null,
int order = 0,
string requiredPolicyName = null)
string? requiredPolicyName = null)
{
toolbar.Contributors.Add(
new SimplePageToolbarContributor(
@ -46,14 +46,14 @@ public static class PageToolbarExtensions
this PageToolbar toolbar,
string text,
Func<Task> clicked,
object icon = null,
Color color = null,
object? icon = null,
Color? color = null,
bool disabled = false,
int order = 0,
string requiredPolicyName = null)
string? requiredPolicyName = null)
{
toolbar.AddComponent<ToolbarButton>(
new Dictionary<string, object>
new Dictionary<string, object?>
{
{ nameof(ToolbarButton.Color), color ?? Color.Primary},
{ nameof(ToolbarButton.Text), text},

5
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarItem.cs

@ -9,14 +9,13 @@ public class PageToolbarItem
[NotNull]
public Type ComponentType { get; }
[CanBeNull]
public Dictionary<string, object> Arguments { get; set; }
public Dictionary<string, object?>? Arguments { get; set; }
public int Order { get; set; }
public PageToolbarItem(
[NotNull] Type componentType,
[CanBeNull] Dictionary<string, object> arguments = null,
Dictionary<string, object?>? arguments = null,
int order = 0)
{
ComponentType = Check.NotNull(componentType, nameof(componentType));

8
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/SimplePageToolbarContributor.cs

@ -10,17 +10,17 @@ public class SimplePageToolbarContributor : IPageToolbarContributor
{
public Type ComponentType { get; }
public Dictionary<string, object> Arguments { get; set; }
public Dictionary<string, object?>? Arguments { get; set; }
public int Order { get; }
public string RequiredPolicyName { get; }
public string? RequiredPolicyName { get; }
public SimplePageToolbarContributor(
Type componentType,
Dictionary<string, object> arguments = null,
Dictionary<string, object?>? arguments = null,
int order = 0,
string requiredPolicyName = null)
string? requiredPolicyName = null)
{
ComponentType = componentType;
Arguments = arguments;

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Routing/AbpRouterOptions.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
public class AbpRouterOptions
{
public Assembly AppAssembly { get; set; }
public Assembly AppAssembly { get; set; } = default!;
public RouterAssemblyList AdditionalAssemblies { get; }

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/AbpThemingOptions.cs

@ -4,7 +4,7 @@ public class AbpThemingOptions
{
public ThemeDictionary Themes { get; }
public string DefaultThemeName { get; set; }
public string? DefaultThemeName { get; set; }
public AbpThemingOptions()
{

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/DefaultThemeManager.cs

@ -9,7 +9,7 @@ public class DefaultThemeManager : IThemeManager, IScopedDependency, IServicePro
public IServiceProvider ServiceProvider { get; }
public ITheme CurrentTheme => GetCurrentTheme();
private ITheme _currentTheme;
private ITheme? _currentTheme;
protected IThemeSelector ThemeSelector { get; }

3
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs

@ -17,8 +17,7 @@ public interface IToolbarConfigurationContext : IServiceProviderAccessor
Task<bool> IsGrantedAsync(string policyName);
[CanBeNull]
IStringLocalizer GetDefaultLocalizer();
IStringLocalizer? GetDefaultLocalizer();
[NotNull]
public IStringLocalizer GetLocalizer<T>();

3
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarConfigurationContext.cs

@ -32,8 +32,7 @@ public class ToolbarConfigurationContext : IToolbarConfigurationContext
return AuthorizationService.IsGrantedAsync(policyName);
}
[CanBeNull]
public IStringLocalizer GetDefaultLocalizer()
public IStringLocalizer? GetDefaultLocalizer()
{
return StringLocalizerFactory.CreateDefaultOrNull();
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarItem.cs

@ -9,7 +9,7 @@ public class ToolbarItem
get => _componentType;
set => _componentType = Check.NotNull(value, nameof(value));
}
private Type _componentType;
private Type _componentType = default!;
public int Order { get; set; }

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<RootNamespace />
</PropertyGroup>

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorClientHttpMessageHandler.cs

@ -82,7 +82,7 @@ public class AbpBlazorClientHttpMessageHandler : DelegatingHandler, ITransientDe
var selfUri = new Uri(_navigationManager.Uri);
if (request.RequestUri.Host != selfUri.Host || request.RequestUri.Port != selfUri.Port)
if (request.RequestUri!.Host != selfUri.Host || request.RequestUri.Port != selfUri.Port)
{
return;
}

4
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs

@ -14,12 +14,12 @@ public class AbpBlazorMessageLocalizerHelper<T>
this.stringLocalizer = stringLocalizer;
}
public string Localize(string message, [CanBeNull] IEnumerable<string> arguments)
public string Localize(string message, IEnumerable<string>? arguments)
{
try
{
return arguments?.Count() > 0
? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()]
? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()!]
: stringLocalizer[message];
}
catch

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieOptions.cs

@ -5,6 +5,6 @@ namespace Volo.Abp.AspNetCore.Components.Web;
public class CookieOptions
{
public DateTimeOffset? ExpireDate { get; set; }
public string Path { get; set; }
public string? Path { get; set; }
public bool Secure { get; set; }
}

4
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieService.cs

@ -14,7 +14,7 @@ public class CookieService : ICookieService, ITransientDependency
JsRuntime = jsRuntime;
}
public async ValueTask SetAsync(string key, string value, CookieOptions options)
public async ValueTask SetAsync(string key, string value, CookieOptions? options)
{
await JsRuntime.InvokeVoidAsync("abp.utils.setCookieValue", key, value, options?.ExpireDate?.ToString("r"), options?.Path, options?.Secure);
}
@ -24,7 +24,7 @@ public class CookieService : ICookieService, ITransientDependency
return await JsRuntime.InvokeAsync<string>("abp.utils.getCookieValue", key);
}
public async ValueTask DeleteAsync(string key, string path = null)
public async ValueTask DeleteAsync(string key, string? path = null)
{
await JsRuntime.InvokeVoidAsync("abp.utils.deleteCookie", key);
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DefaultServerUrlProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.AspNetCore.Components.Web;
public class DefaultServerUrlProvider : IServerUrlProvider, ISingletonDependency
{
public Task<string> GetBaseUrlAsync(string remoteServiceName = null)
public Task<string> GetBaseUrlAsync(string? remoteServiceName = null)
{
return Task.FromResult("/");
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs

@ -7,5 +7,5 @@ public class ComponentsClientScopeServiceProviderAccessor :
IClientScopeServiceProviderAccessor,
ISingletonDependency
{
public IServiceProvider ServiceProvider { get; set; }
public IServiceProvider ServiceProvider { get; set; } = default!;
}

6
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger.cs

@ -8,7 +8,7 @@ namespace Volo.Abp.AspNetCore.Components.Web.ExceptionHandling;
public class AbpExceptionHandlingLogger : ILogger
{
private readonly IServiceCollection _serviceCollection;
private IUserExceptionInformer _userExceptionInformer;
private IUserExceptionInformer? _userExceptionInformer;
public AbpExceptionHandlingLogger(IServiceCollection serviceCollection)
{
@ -19,7 +19,7 @@ public class AbpExceptionHandlingLogger : ILogger
LogLevel logLevel,
EventId eventId,
TState state,
Exception exception,
Exception? exception,
Func<TState, Exception, string> formatter)
{
if (exception == null)
@ -58,7 +58,7 @@ public class AbpExceptionHandlingLogger : ILogger
return logLevel == LogLevel.Critical || logLevel == LogLevel.Error;
}
public virtual IDisposable BeginScope<TState>(TState state)
public virtual IDisposable? BeginScope<TState>(TState state) where TState : notnull
{
return NullDisposable.Instance;
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLoggerProvider.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.AspNetCore.Components.Web.ExceptionHandling;
public class AbpExceptionHandlingLoggerProvider : ILoggerProvider
{
private AbpExceptionHandlingLogger _logger;
private AbpExceptionHandlingLogger? _logger;
private static readonly object SyncObj = new object();
private readonly IServiceCollection _serviceCollection;

8
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs

@ -39,11 +39,11 @@ public class UserExceptionInformer : IUserExceptionInformer, IScopedDependency
if (errorInfo.Details.IsNullOrEmpty())
{
MessageService.Error(errorInfo.Message);
MessageService.Error(errorInfo.Message!);
}
else
{
MessageService.Error(errorInfo.Details, errorInfo.Message);
MessageService.Error(errorInfo.Details!, errorInfo.Message);
}
}
@ -53,11 +53,11 @@ public class UserExceptionInformer : IUserExceptionInformer, IScopedDependency
if (errorInfo.Details.IsNullOrEmpty())
{
await MessageService.Error(errorInfo.Message);
await MessageService.Error(errorInfo.Message!);
}
else
{
await MessageService.Error(errorInfo.Details, errorInfo.Message);
await MessageService.Error(errorInfo.Details!, errorInfo.Message);
}
}

14
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs

@ -5,15 +5,15 @@ namespace Volo.Abp.AspNetCore.Components.Web.Extensibility.EntityActions;
public class EntityAction : IEquatable<EntityAction>
{
public string Text { get; set; }
public Func<object, Task> Clicked { get; set; }
public Func<object, string> ConfirmationMessage { get; set; }
public string Text { get; set; } = default!;
public Func<object, Task> Clicked { get; set; } = default!;
public Func<object, string>? ConfirmationMessage { get; set; }
public bool Primary { get; set; }
public object Color { get; set; }
public string Icon { get; set; }
public Func<object, bool> Visible { get; set; }
public object? Color { get; set; }
public string? Icon { get; set; }
public Func<object, bool>? Visible { get; set; }
public bool Disabled { get; set; }
public bool Equals(EntityAction other)
public bool Equals(EntityAction? other)
{
return string.Equals(Text, other?.Text, StringComparison.OrdinalIgnoreCase);
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityActionDictionary.cs

@ -6,6 +6,6 @@ public class EntityActionDictionary : Dictionary<string, List<EntityAction>>
{
public List<EntityAction> Get<T>()
{
return this.GetOrAdd(typeof(T).FullName, () => new List<EntityAction>());
return this.GetOrAdd(typeof(T).FullName!, () => new List<EntityAction>());
}
}

15
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs

@ -8,23 +8,20 @@ namespace Volo.Abp.AspNetCore.Components.Web.Extensibility.TableColumns;
public class TableColumn
{
public string Title { get; set; }
public string Data { get; set; }
public string Title { get; set; } = default!;
public string Data { get; set; } = default!;
public string PropertyName { get; set; }
public string PropertyName { get; set; } = default!;
[CanBeNull]
public string DisplayFormat { get; set; }
public string? DisplayFormat { get; set; }
public IFormatProvider DisplayFormatProvider { get; set; } = CultureInfo.CurrentCulture;
[CanBeNull]
public Type Component { get; set; }
public Type? Component { get; set; }
public List<EntityAction> Actions { get; set; }
[CanBeNull]
public Func<object, string> ValueConverter { get; set; }
public Func<object, string>? ValueConverter { get; set; }
public bool Sortable { get; set; }

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumnDictionary.cs

@ -6,6 +6,6 @@ public class TableColumnDictionary : Dictionary<string, List<TableColumn>>
{
public List<TableColumn> Get<T>()
{
return this.GetOrAdd(typeof(T).FullName, () => new List<TableColumn>());
return this.GetOrAdd(typeof(T).FullName!, () => new List<TableColumn>());
}
}

4
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ICookieService.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.AspNetCore.Components.Web;
public interface ICookieService
{
public ValueTask SetAsync(string key, string value, CookieOptions options = null);
public ValueTask SetAsync(string key, string value, CookieOptions? options = null);
public ValueTask<string> GetAsync(string key);
public ValueTask DeleteAsync(string key, string path = null);
public ValueTask DeleteAsync(string key, string? path = null);
}

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/IServerUrlProvider.cs

@ -4,5 +4,5 @@ namespace Volo.Abp.AspNetCore.Components.Web;
public interface IServerUrlProvider
{
Task<string> GetBaseUrlAsync(string remoteServiceName = null);
Task<string> GetBaseUrlAsync(string? remoteServiceName = null);
}

10
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Messages/SimpleUiMessageService.cs

@ -15,27 +15,27 @@ public class SimpleUiMessageService : IUiMessageService, ITransientDependency
JsRuntime = jsRuntime;
}
public async Task Info(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Info(string message, string? title = null, Action<UiMessageOptions>? options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Success(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Success(string message, string? title = null, Action<UiMessageOptions>? options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Warn(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Warn(string message, string? title = null, Action<UiMessageOptions>? options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task Error(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task Error(string message, string? title = null, Action<UiMessageOptions>? options = null)
{
await JsRuntime.InvokeVoidAsync("alert", message);
}
public async Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null)
public async Task<bool> Confirm(string message, string? title = null, Action<UiMessageOptions>? options = null)
{
return await JsRuntime.InvokeAsync<bool>("confirm", message);
}

5
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/AbpComponentsClaimsCache.cs

@ -9,10 +9,9 @@ namespace Volo.Abp.AspNetCore.Components.Web.Security;
public class AbpComponentsClaimsCache : IScopedDependency
{
public ClaimsPrincipal Principal { get; private set; }
public ClaimsPrincipal Principal { get; private set; } = default!;
[CanBeNull]
private readonly AuthenticationStateProvider _authenticationStateProvider;
private readonly AuthenticationStateProvider? _authenticationStateProvider;
public AbpComponentsClaimsCache(
IClientScopeServiceProviderAccessor serviceProviderAccessor)

2
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Security/ApplicationConfigurationChangedService.cs

@ -6,7 +6,7 @@ public delegate void ApplicationConfigurationChangedHandler();
public class ApplicationConfigurationChangedService : IScopedDependency
{
public event ApplicationConfigurationChangedHandler Changed;
public event ApplicationConfigurationChangedHandler Changed = default!;
public void NotifyChanged()
{

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.Theming/Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>

4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/Extensions/DependencyInjection/EmptyWebAssemblyHostEnvironment.cs

@ -4,7 +4,7 @@ namespace Microsoft.Extensions.DependencyInjection;
public class EmptyWebAssemblyHostEnvironment : IWebAssemblyHostEnvironment
{
public string Environment { get; set; }
public string Environment { get; set; } = default!;
public string BaseAddress { get; set; }
public string BaseAddress { get; set; } = default!;
}

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo.Abp.AspNetCore.Components.WebAssembly.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.AspNetCore.Components.WebAssembly</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Components.WebAssembly</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs

@ -67,7 +67,7 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule
var cultureName = configuration.Localization?.CurrentCulture?.CultureName;
if (!cultureName.IsNullOrEmpty())
{
var culture = new CultureInfo(cultureName);
var culture = new CultureInfo(cultureName!);
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
}

4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ApplicationConfigurationCache.cs

@ -5,9 +5,9 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly;
public class ApplicationConfigurationCache : ISingletonDependency
{
protected ApplicationConfigurationDto Configuration { get; set; }
protected ApplicationConfigurationDto? Configuration { get; set; }
public virtual ApplicationConfigurationDto Get()
public virtual ApplicationConfigurationDto? Get()
{
return Configuration;
}

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCurrentTenantAccessor.cs

@ -6,5 +6,5 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly;
[Dependency(ReplaceServices = true)]
public class WebAssemblyCurrentTenantAccessor : ICurrentTenantAccessor, ISingletonDependency
{
public BasicTenantInfo Current { get; set; }
public BasicTenantInfo? Current { get; set; }
}

2
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyServerUrlProvider.cs

@ -17,7 +17,7 @@ public class WebAssemblyServerUrlProvider : IServerUrlProvider, ITransientDepend
RemoteServiceConfigurationProvider = remoteServiceConfigurationProvider;
}
public async Task<string> GetBaseUrlAsync(string remoteServiceName = null)
public async Task<string> GetBaseUrlAsync(string? remoteServiceName = null)
{
var remoteServiceConfiguration = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(
remoteServiceName ?? RemoteServiceConfigurationDictionary.DefaultName

2
framework/src/Volo.Abp.AspNetCore.Components/Volo.Abp.AspNetCore.Components.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.AspNetCore.Components</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Components</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

70
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/AbpComponentBase.cs

@ -20,8 +20,8 @@ namespace Volo.Abp.AspNetCore.Components;
public abstract class AbpComponentBase : OwningComponentBase
{
protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory);
private IStringLocalizerFactory _stringLocalizerFactory;
protected IStringLocalizerFactory StringLocalizerFactory => LazyGetRequiredService(ref _stringLocalizerFactory)!;
private IStringLocalizerFactory? _stringLocalizerFactory;
protected IStringLocalizer L {
get {
@ -33,46 +33,46 @@ public abstract class AbpComponentBase : OwningComponentBase
return _localizer;
}
}
private IStringLocalizer _localizer;
private IStringLocalizer? _localizer;
protected Type LocalizationResource {
protected Type? LocalizationResource {
get => _localizationResource;
set {
_localizationResource = value;
_localizer = null;
}
}
private Type _localizationResource = typeof(DefaultResource);
private Type? _localizationResource = typeof(DefaultResource);
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance, true);
protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory);
private ILoggerFactory _loggerFactory;
protected ILoggerFactory LoggerFactory => LazyGetRequiredService(ref _loggerFactory)!;
private ILoggerFactory? _loggerFactory;
protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService);
private IAuthorizationService _authorizationService;
protected IAuthorizationService AuthorizationService => LazyGetRequiredService(ref _authorizationService)!;
private IAuthorizationService? _authorizationService;
protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser);
private ICurrentUser _currentUser;
protected ICurrentUser CurrentUser => LazyGetRequiredService(ref _currentUser)!;
private ICurrentUser? _currentUser;
protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant);
private ICurrentTenant _currentTenant;
protected ICurrentTenant CurrentTenant => LazyGetRequiredService(ref _currentTenant)!;
private ICurrentTenant? _currentTenant;
protected IUiMessageService Message => LazyGetNonScopedRequiredService(ref _message);
private IUiMessageService _message;
protected IUiMessageService Message => LazyGetNonScopedRequiredService(ref _message)!;
private IUiMessageService? _message;
protected IUiNotificationService Notify => LazyGetNonScopedRequiredService(ref _notify);
private IUiNotificationService _notify;
protected IUiNotificationService Notify => LazyGetNonScopedRequiredService(ref _notify)!;
private IUiNotificationService? _notify;
protected IUserExceptionInformer UserExceptionInformer => LazyGetNonScopedRequiredService(ref _userExceptionInformer);
private IUserExceptionInformer _userExceptionInformer;
protected IUserExceptionInformer UserExceptionInformer => LazyGetNonScopedRequiredService(ref _userExceptionInformer)!;
private IUserExceptionInformer? _userExceptionInformer;
protected IAlertManager AlertManager => LazyGetNonScopedRequiredService(ref _alertManager);
private IAlertManager _alertManager;
protected IAlertManager AlertManager => LazyGetNonScopedRequiredService(ref _alertManager)!;
private IAlertManager? _alertManager;
protected IClock Clock => LazyGetNonScopedRequiredService(ref _clock);
private IClock _clock;
protected IClock Clock => LazyGetNonScopedRequiredService(ref _clock)!;
private IClock? _clock;
protected AlertList Alerts => AlertManager.Alerts;
@ -85,19 +85,19 @@ public abstract class AbpComponentBase : OwningComponentBase
if (ObjectMapperContext == null)
{
return LazyGetRequiredService(ref _objectMapper);
return LazyGetRequiredService(ref _objectMapper)!;
}
return LazyGetRequiredService(
typeof(IObjectMapper<>).MakeGenericType(ObjectMapperContext),
ref _objectMapper
);
)!;
}
}
private IObjectMapper _objectMapper;
private IObjectMapper? _objectMapper;
protected Type ObjectMapperContext { get; set; }
protected Type? ObjectMapperContext { get; set; }
protected TService LazyGetRequiredService<TService>(ref TService reference) => LazyGetRequiredService(typeof(TService), ref reference);
@ -111,13 +111,13 @@ public abstract class AbpComponentBase : OwningComponentBase
return reference;
}
protected TService LazyGetService<TService>(ref TService reference) => LazyGetService(typeof(TService), ref reference);
protected TService? LazyGetService<TService>(ref TService? reference) => LazyGetService(typeof(TService), ref reference);
protected TRef LazyGetService<TRef>(Type serviceType, ref TRef reference)
protected TRef? LazyGetService<TRef>(Type serviceType, ref TRef? reference)
{
if (reference == null)
{
reference = (TRef)ScopedServices.GetService(serviceType);
reference = (TRef?)ScopedServices.GetService(serviceType);
}
return reference;
@ -135,20 +135,20 @@ public abstract class AbpComponentBase : OwningComponentBase
return reference;
}
protected TService LazyGetNonScopedService<TService>(ref TService reference) => LazyGetNonScopedService(typeof(TService), ref reference);
protected TService? LazyGetNonScopedService<TService>(ref TService? reference) => LazyGetNonScopedService(typeof(TService), ref reference);
protected TRef LazyGetNonScopedService<TRef>(Type serviceType, ref TRef reference)
protected TRef? LazyGetNonScopedService<TRef>(Type serviceType, ref TRef? reference)
{
if (reference == null)
{
reference = (TRef)NonScopedServices.GetService(serviceType);
reference = (TRef?)NonScopedServices.GetService(serviceType);
}
return reference;
}
[Inject]
protected IServiceProvider NonScopedServices { get; set; }
protected IServiceProvider NonScopedServices { get; set; } = default!;
protected virtual IStringLocalizer CreateLocalizer()
{

10
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Alerts/AlertList.cs

@ -9,27 +9,27 @@ namespace Volo.Abp.AspNetCore.Components.Alerts;
public class AlertList : ObservableCollection<AlertMessage>
{
public void Add(AlertType type, string text, string title = null, bool dismissible = true)
public void Add(AlertType type, string text, string? title = null, bool dismissible = true)
{
Add(new AlertMessage(type, text, title, dismissible));
}
public void Info(string text, string title = null, bool dismissible = true)
public void Info(string text, string? title = null, bool dismissible = true)
{
Add(new AlertMessage(AlertType.Info, text, title, dismissible));
}
public void Warning(string text, string title = null, bool dismissible = true)
public void Warning(string text, string? title = null, bool dismissible = true)
{
Add(new AlertMessage(AlertType.Warning, text, title, dismissible));
}
public void Danger(string text, string title = null, bool dismissible = true)
public void Danger(string text, string? title = null, bool dismissible = true)
{
Add(new AlertMessage(AlertType.Danger, text, title, dismissible));
}
public void Success(string text, string title = null, bool dismissible = true)
public void Success(string text, string? title = null, bool dismissible = true)
{
Add(new AlertMessage(AlertType.Success, text, title, dismissible));
}

7
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Alerts/AlertMessage.cs

@ -9,16 +9,15 @@ public class AlertMessage
get => _text;
set => _text = Check.NotNullOrWhiteSpace(value, nameof(value));
}
private string _text;
private string _text = default!;
public AlertType Type { get; set; }
[CanBeNull]
public string Title { get; set; }
public string? Title { get; set; }
public bool Dismissible { get; set; }
public AlertMessage(AlertType type, [NotNull] string text, string title = null, bool dismissible = true)
public AlertMessage(AlertType type, [NotNull] string text, string? title = null, bool dismissible = true)
{
Type = type;
Text = Check.NotNullOrWhiteSpace(text, nameof(text));

10
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs

@ -5,13 +5,13 @@ namespace Volo.Abp.AspNetCore.Components.Messages;
public interface IUiMessageService
{
Task Info(string message, string title = null, Action<UiMessageOptions> options = null);
Task Info(string message, string? title = null, Action<UiMessageOptions>? options = null);
Task Success(string message, string title = null, Action<UiMessageOptions> options = null);
Task Success(string message, string? title = null, Action<UiMessageOptions>? options = null);
Task Warn(string message, string title = null, Action<UiMessageOptions> options = null);
Task Warn(string message, string? title = null, Action<UiMessageOptions>? options = null);
Task Error(string message, string title = null, Action<UiMessageOptions> options = null);
Task Error(string message, string? title = null, Action<UiMessageOptions>? options = null);
Task<bool> Confirm(string message, string title = null, Action<UiMessageOptions> options = null);
Task<bool> Confirm(string message, string? title = null, Action<UiMessageOptions>? options = null);
}

2
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageEventArgs.cs

@ -30,5 +30,5 @@ public class UiMessageEventArgs : EventArgs
public UiMessageOptions Options { get; }
public TaskCompletionSource<bool> Callback { get; }
public TaskCompletionSource<bool> Callback { get; } = default!;
}

14
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/UiMessageOptions.cs

@ -18,35 +18,35 @@ public class UiMessageOptions
/// <summary>
/// Overrides the build-in message icon.
/// </summary>
public object MessageIcon { get; set; }
public object? MessageIcon { get; set; }
/// <summary>
/// Custom text for the Ok button.
/// </summary>
public string OkButtonText { get; set; }
public string? OkButtonText { get; set; }
/// <summary>
/// Custom icon for the Ok button.
/// </summary>
public object OkButtonIcon { get; set; }
public object? OkButtonIcon { get; set; }
/// <summary>
/// Custom text for the Confirmation button.
/// </summary>
public string ConfirmButtonText { get; set; }
public string? ConfirmButtonText { get; set; }
/// <summary>
/// Custom icon for the Confirmation button.
/// </summary>
public object ConfirmButtonIcon { get; set; }
public object? ConfirmButtonIcon { get; set; }
/// <summary>
/// Custom text for the Cancel button.
/// </summary>
public string CancelButtonText { get; set; }
public string? CancelButtonText { get; set; }
/// <summary>
/// Custom icon for the Cancel button.
/// </summary>
public object CancelButtonIcon { get; set; }
public object? CancelButtonIcon { get; set; }
}

8
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs

@ -5,11 +5,11 @@ namespace Volo.Abp.AspNetCore.Components.Notifications;
public interface IUiNotificationService
{
Task Info(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Info(string message, string? title = null, Action<UiNotificationOptions>? options = null);
Task Success(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Success(string message, string? title = null, Action<UiNotificationOptions>? options = null);
Task Warn(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Warn(string message, string? title = null, Action<UiNotificationOptions>? options = null);
Task Error(string message, string title = null, Action<UiNotificationOptions> options = null);
Task Error(string message, string? title = null, Action<UiNotificationOptions>? options = null);
}

8
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/NullUiNotificationService.cs

@ -6,21 +6,21 @@ namespace Volo.Abp.AspNetCore.Components.Notifications;
public class NullUiNotificationService : IUiNotificationService, ITransientDependency
{
public Task Info(string message, string title = null, Action<UiNotificationOptions> options = null)
public Task Info(string message, string? title = null, Action<UiNotificationOptions>? options = null)
{
return Task.CompletedTask;
}
public Task Success(string message, string title = null, Action<UiNotificationOptions> options = null)
public Task Success(string message, string? title = null, Action<UiNotificationOptions>? options = null)
{
return Task.CompletedTask;
}
public Task Warn(string message, string title = null, Action<UiNotificationOptions> options = null)
public Task Warn(string message, string? title = null, Action<UiNotificationOptions>? options = null)
{
return Task.CompletedTask;
}
public Task Error(string message, string title = null, Action<UiNotificationOptions> options = null)
public Task Error(string message, string? title = null, Action<UiNotificationOptions>? options = null)
{
return Task.CompletedTask;
}

4
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/UiNotificationOptions.cs

@ -10,10 +10,10 @@ public class UiNotificationOptions
/// <summary>
/// Custom text for the Ok button.
/// </summary>
public ILocalizableString OkButtonText { get; set; }
public ILocalizableString? OkButtonText { get; set; }
/// <summary>
/// Custom icon for the Ok button.
/// </summary>
public object OkButtonIcon { get; set; }
public object? OkButtonIcon { get; set; }
}

2
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Progression/IUiPageProgressService.cs

@ -16,5 +16,5 @@ public interface IUiPageProgressService
/// <param name="percentage">Value of the progress from 0 to 100, or null for indeterminate progress.</param>
/// <param name="options">Additional options.</param>
/// <returns>Awaitable task.</returns>
Task Go(int? percentage, Action<UiPageProgressOptions> options = null);
Task Go(int? percentage, Action<UiPageProgressOptions>? options = null);
}

4
framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Progression/NullUiPageProgressService.cs

@ -6,9 +6,9 @@ namespace Volo.Abp.AspNetCore.Components.Progression;
public class NullUiPageProgressService : IUiPageProgressService, ISingletonDependency
{
public event EventHandler<UiPageProgressEventArgs> ProgressChanged;
public event EventHandler<UiPageProgressEventArgs> ProgressChanged = default!;
public Task Go(int? percentage, Action<UiPageProgressOptions> options = null)
public Task Go(int? percentage, Action<UiPageProgressOptions>? options = null)
{
return Task.CompletedTask;
}

2
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpApplicationBuilderExtensions.cs

@ -82,7 +82,7 @@ public static class AbpApplicationBuilderExtensions
}
public static IApplicationBuilder UseAbpRequestLocalization(this IApplicationBuilder app,
Action<RequestLocalizationOptions> optionsAction = null)
Action<RequestLocalizationOptions>? optionsAction = null)
{
app.ApplicationServices
.GetRequiredService<IAbpRequestLocalizationOptionsProvider>()

2
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/AbpAspNetCoreApplicationBuilderExtensions.cs

@ -17,7 +17,7 @@ public static class AbpAspNetCoreApplicationBuilderExtensions
/// <returns></returns>
public static IApplicationBuilder UseConfiguredEndpoints(
this IApplicationBuilder app,
Action<IEndpointRouteBuilder> additionalConfigurationAction = null)
Action<IEndpointRouteBuilder>? additionalConfigurationAction = null)
{
var options = app.ApplicationServices
.GetRequiredService<IOptions<AbpEndpointRouterOptions>>()

2
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Builder/VirtualFileSystemApplicationBuilderExtensions.cs

@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Builder;
public static class VirtualFileSystemApplicationBuilderExtensions
{
[Obsolete("Use UseStaticFiles() instead. UseVirtualFiles is not needed anymore.")]
public static IApplicationBuilder UseVirtualFiles(this IApplicationBuilder app, Action<StaticFileOptions> configure = null)
public static IApplicationBuilder UseVirtualFiles(this IApplicationBuilder app, Action<StaticFileOptions>? configure = null)
{
if (configure != null)
{

2
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Hosting/AbpHostingEnvironmentExtensions.cs

@ -7,7 +7,7 @@ public static class AbpHostingEnvironmentExtensions
{
public static IConfigurationRoot BuildConfiguration(
this IWebHostEnvironment env,
AbpConfigurationBuilderOptions options = null)
AbpConfigurationBuilderOptions? options = null)
{
options ??= new AbpConfigurationBuilderOptions();

4
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs

@ -28,7 +28,7 @@ public static class ResponseContentTypeHelper
string? actionResultContentType,
string? httpResponseContentType,
(string defaultContentType, Encoding defaultEncoding) @default,
Func<string, Encoding> getEncoding,
Func<string, Encoding?> getEncoding,
out string resolvedContentType,
out Encoding resolvedContentTypeEncoding)
{
@ -66,7 +66,7 @@ public static class ResponseContentTypeHelper
resolvedContentTypeEncoding = defaultContentTypeEncoding;
}
public static Encoding GetEncoding(string mediaType)
public static Encoding? GetEncoding(string mediaType)
{
if (MediaTypeHeaderValue.TryParse(mediaType, out var parsed))
{

4
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestLocalizationOptionsManager.cs

@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.RequestLocalization;
public class AbpRequestLocalizationOptionsManager : AbpDynamicOptionsManager<RequestLocalizationOptions>
{
private RequestLocalizationOptions _options;
private RequestLocalizationOptions? _options;
private readonly IAbpRequestLocalizationOptionsProvider _abpRequestLocalizationOptionsProvider;
@ -19,7 +19,7 @@ public class AbpRequestLocalizationOptionsManager : AbpDynamicOptionsManager<Req
_abpRequestLocalizationOptionsProvider = abpRequestLocalizationOptionsProvider;
}
public override RequestLocalizationOptions Get(string name)
public override RequestLocalizationOptions Get(string? name)
{
return _options ?? base.Get(name);
}

8
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/DefaultAbpRequestLocalizationOptionsProvider.cs

@ -19,8 +19,8 @@ public class DefaultAbpRequestLocalizationOptionsProvider : IAbpRequestLocalizat
{
private readonly IServiceScopeFactory _serviceProviderFactory;
private readonly SemaphoreSlim _syncSemaphore;
private Action<RequestLocalizationOptions> _optionsAction;
private RequestLocalizationOptions _requestLocalizationOptions;
private Action<RequestLocalizationOptions>? _optionsAction;
private RequestLocalizationOptions? _requestLocalizationOptions;
public DefaultAbpRequestLocalizationOptionsProvider(IServiceScopeFactory serviceProviderFactory)
{
@ -28,7 +28,7 @@ public class DefaultAbpRequestLocalizationOptionsProvider : IAbpRequestLocalizat
_syncSemaphore = new SemaphoreSlim(1, 1);
}
public void InitLocalizationOptions(Action<RequestLocalizationOptions> optionsAction = null)
public void InitLocalizationOptions(Action<RequestLocalizationOptions>? optionsAction = null)
{
_optionsAction = optionsAction;
}
@ -85,7 +85,7 @@ public class DefaultAbpRequestLocalizationOptionsProvider : IAbpRequestLocalizat
return _requestLocalizationOptions;
}
private static RequestCulture DefaultGetRequestCulture(string defaultLanguage, IReadOnlyList<LanguageInfo> languages)
private static RequestCulture DefaultGetRequestCulture(string? defaultLanguage, IReadOnlyList<LanguageInfo> languages)
{
if (defaultLanguage == null)
{

2
framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/IAbpRequestLocalizationOptionsProvider.cs

@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.RequestLocalization;
public interface IAbpRequestLocalizationOptionsProvider
{
void InitLocalizationOptions(Action<RequestLocalizationOptions> optionsAction = null);
void InitLocalizationOptions(Action<RequestLocalizationOptions>? optionsAction = null);
Task<RequestLocalizationOptions> GetLocalizationOptionsAsync();
}

2
framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/CookieAuthenticationOptionsExtensions.cs

@ -47,7 +47,7 @@ public static class CookieAuthenticationOptionsExtensions
var response = await openIdConnectOptions.Backchannel.IntrospectTokenAsync(new TokenIntrospectionRequest
{
Address = openIdConnectOptions.Configuration?.IntrospectionEndpoint ?? openIdConnectOptions.Authority.EnsureEndsWith('/') + "connect/introspect",
Address = openIdConnectOptions.Configuration?.IntrospectionEndpoint ?? openIdConnectOptions.Authority!.EnsureEndsWith('/') + "connect/introspect",
ClientId = openIdConnectOptions.ClientId,
ClientSecret = openIdConnectOptions.ClientSecret,
Token = accessToken

12
framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/EmptyHostingEnvironment.cs

@ -5,15 +5,15 @@ namespace Microsoft.Extensions.DependencyInjection;
internal class EmptyHostingEnvironment : IWebHostEnvironment
{
public string EnvironmentName { get; set; }
public string EnvironmentName { get; set; } = default!;
public string ApplicationName { get; set; }
public string ApplicationName { get; set; } = default!;
public string WebRootPath { get; set; }
public string WebRootPath { get; set; } = default!;
public IFileProvider WebRootFileProvider { get; set; }
public IFileProvider WebRootFileProvider { get; set; } = default!;
public string ContentRootPath { get; set; }
public string ContentRootPath { get; set; } = default!;
public IFileProvider ContentRootFileProvider { get; set; }
public IFileProvider ContentRootFileProvider { get; set; } = default!;
}

4
framework/src/Volo.Abp.AspNetCore/Microsoft/Extensions/DependencyInjection/WebApplicationBuilderExtensions.cs

@ -11,7 +11,7 @@ public static class WebApplicationBuilderExtensions
{
public static async Task<IAbpApplicationWithExternalServiceProvider> AddApplicationAsync<TStartupModule>(
[NotNull] this WebApplicationBuilder builder,
[CanBeNull] Action<AbpApplicationCreationOptions> optionsAction = null)
Action<AbpApplicationCreationOptions>? optionsAction = null)
where TStartupModule : IAbpModule
{
return await builder.Services.AddApplicationAsync<TStartupModule>(options =>
@ -28,7 +28,7 @@ public static class WebApplicationBuilderExtensions
public static async Task<IAbpApplicationWithExternalServiceProvider> AddApplicationAsync(
[NotNull] this WebApplicationBuilder builder,
[NotNull] Type startupModuleType,
[CanBeNull] Action<AbpApplicationCreationOptions> optionsAction = null)
Action<AbpApplicationCreationOptions>? optionsAction = null)
{
return await builder.Services.AddApplicationAsync(startupModuleType, options =>
{

2
framework/src/Volo.Abp.AspNetCore/Volo.Abp.AspNetCore.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.AspNetCore</AssemblyName>
<PackageId>Volo.Abp.AspNetCore</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

5
framework/src/Volo.Abp.AspNetCore/Volo/Abp/ApplicationInitializationContextExtensions.cs

@ -12,7 +12,7 @@ public static class ApplicationInitializationContextExtensions
{
public static IApplicationBuilder GetApplicationBuilder(this ApplicationInitializationContext context)
{
return context.ServiceProvider.GetRequiredService<IObjectAccessor<IApplicationBuilder>>().Value;
return context.ServiceProvider.GetRequiredService<IObjectAccessor<IApplicationBuilder>>().Value!;
}
public static IWebHostEnvironment GetEnvironment(this ApplicationInitializationContext context)
@ -20,8 +20,7 @@ public static class ApplicationInitializationContextExtensions
return context.ServiceProvider.GetRequiredService<IWebHostEnvironment>();
}
[CanBeNull]
public static IWebHostEnvironment GetEnvironmentOrNull(this ApplicationInitializationContext context)
public static IWebHostEnvironment? GetEnvironmentOrNull(this ApplicationInitializationContext context)
{
return context.ServiceProvider.GetService<IWebHostEnvironment>();
}

2
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpAuthorizationExceptionHandlerOptions.cs

@ -2,5 +2,5 @@
public class AbpAuthorizationExceptionHandlerOptions
{
public string AuthenticationScheme { get; set; }
public string? AuthenticationScheme { get; set; }
}

4
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultAbpAuthorizationExceptionHandler.cs

@ -17,11 +17,11 @@ public class DefaultAbpAuthorizationExceptionHandler : IAbpAuthorizationExceptio
var isAuthenticated = httpContext.User.Identity?.IsAuthenticated ?? false;
var authenticationSchemeProvider = httpContext.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>();
AuthenticationScheme scheme = null;
AuthenticationScheme? scheme = null;
if (!handlerOptions.AuthenticationScheme.IsNullOrWhiteSpace())
{
scheme = await authenticationSchemeProvider.GetSchemeAsync(handlerOptions.AuthenticationScheme);
scheme = await authenticationSchemeProvider.GetSchemeAsync(handlerOptions.AuthenticationScheme!);
if (scheme == null)
{
throw new AbpException($"No authentication scheme named {handlerOptions.AuthenticationScheme} was found.");

4
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultHttpExceptionStatusCodeFinder.cs

@ -32,7 +32,7 @@ public class DefaultHttpExceptionStatusCodeFinder : IHttpExceptionStatusCodeFind
if (exception is IHasErrorCode exceptionWithErrorCode &&
!exceptionWithErrorCode.Code.IsNullOrWhiteSpace())
{
if (Options.ErrorCodeToHttpStatusCodeMappings.TryGetValue(exceptionWithErrorCode.Code, out var status))
if (Options.ErrorCodeToHttpStatusCodeMappings.TryGetValue(exceptionWithErrorCode.Code!, out var status))
{
return status;
}
@ -40,7 +40,7 @@ public class DefaultHttpExceptionStatusCodeFinder : IHttpExceptionStatusCodeFind
if (exception is AbpAuthorizationException)
{
return httpContext.User.Identity.IsAuthenticated
return httpContext.User.Identity!.IsAuthenticated
? HttpStatusCode.Forbidden
: HttpStatusCode.Unauthorized;
}

6
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersMiddleware.cs

@ -32,7 +32,7 @@ public class AbpSecurityHeadersMiddleware : IMiddleware, ITransientDependency
AddHeader(context, "X-Frame-Options", "SAMEORIGIN");
var requestAcceptTypeHtml = context.Request.Headers["Accept"].Any(x =>
x.Contains("text/html") || x.Contains("*/*") || x.Contains("application/xhtml+xml"));
x!.Contains("text/html") || x.Contains("*/*") || x.Contains("application/xhtml+xml"));
var endpoint = context.GetEndpoint();
@ -109,7 +109,7 @@ public class AbpSecurityHeadersMiddleware : IMiddleware, ITransientDependency
protected virtual string BuildContentSecurityPolicyValue(HttpContext context)
{
var cspValue = Options.Value.ContentSecurityPolicyValue.IsNullOrWhiteSpace() ? DefaultValue : Options.Value.ContentSecurityPolicyValue;
var cspValue = Options.Value.ContentSecurityPolicyValue.IsNullOrWhiteSpace() ? DefaultValue : Options.Value.ContentSecurityPolicyValue!;
if (!(Options.Value.UseContentSecurityPolicyScriptNonce &&
context.Items.TryGetValue(AbpAspNetCoreConsts.ScriptNonceKey, out var nonce) &&
nonce is string nonceValue && !string.IsNullOrEmpty(nonceValue)))
@ -128,7 +128,7 @@ public class AbpSecurityHeadersMiddleware : IMiddleware, ITransientDependency
}
var newScriptSrcValue = scriptSrcValue + nonceStr;
return Options.Value.ContentSecurityPolicyValue.Replace(scriptSrcValue, newScriptSrcValue);
return Options.Value.ContentSecurityPolicyValue!.Replace(scriptSrcValue!, newScriptSrcValue);
}

2
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/AbpSecurityHeadersOptions.cs

@ -11,7 +11,7 @@ public class AbpSecurityHeadersOptions
public bool UseContentSecurityPolicyScriptNonce { get; set; }
public string ContentSecurityPolicyValue { get; set; }
public string? ContentSecurityPolicyValue { get; set; }
public Dictionary<string, string> Headers { get; }

4
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs

@ -38,14 +38,14 @@ public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency
protected virtual string GetCorrelationIdFromRequest(HttpContext context)
{
string correlationId = context.Request.Headers[_options.HttpHeaderName];
string? correlationId = context.Request.Headers[_options.HttpHeaderName];
if (correlationId.IsNullOrEmpty())
{
correlationId = Guid.NewGuid().ToString("N");
context.Request.Headers[_options.HttpHeaderName] = correlationId;
}
return correlationId;
return correlationId!;
}
protected virtual void CheckAndSetCorrelationIdOnResponse(

6
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/AbpFileExtensionContentTypeProvider.cs

@ -18,14 +18,14 @@ public class AbpFileExtensionContentTypeProvider : IContentTypeProvider, ITransi
var extension = GetExtension(subpath);
if (extension == null)
{
contentType = null;
contentType = null!;
return false;
}
return Options.ContentTypeMaps.TryGetValue(extension, out contentType);
return Options.ContentTypeMaps.TryGetValue(extension, out contentType!);
}
protected virtual string GetExtension(string path)
protected virtual string? GetExtension(string path)
{
if (string.IsNullOrWhiteSpace(path))
{

2
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/VirtualFileSystem/RazorViewEngineVirtualFileProvider.cs

@ -16,7 +16,7 @@ public class RazorViewEngineVirtualFileProvider : IFileProvider
{
_serviceProviderAccessor = serviceProviderAccessor;
_fileProvider = new Lazy<IFileProvider>(
() => serviceProviderAccessor.Value.GetRequiredService<IVirtualFileProvider>(),
() => serviceProviderAccessor.Value!.GetRequiredService<IVirtualFileProvider>(),
true
);
}

8
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/WebClientInfo/HttpContextWebClientInfoProvider.cs

@ -18,16 +18,16 @@ public class HttpContextWebClientInfoProvider : IWebClientInfoProvider, ITransie
HttpContextAccessor = httpContextAccessor;
}
public string BrowserInfo => GetBrowserInfo();
public string? BrowserInfo => GetBrowserInfo();
public string ClientIpAddress => GetClientIpAddress();
public string? ClientIpAddress => GetClientIpAddress();
protected virtual string GetBrowserInfo()
protected virtual string? GetBrowserInfo()
{
return HttpContextAccessor.HttpContext?.Request?.Headers?["User-Agent"];
}
protected virtual string GetClientIpAddress()
protected virtual string? GetClientIpAddress()
{
try
{

4
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/WebClientInfo/IWebClientInfoProvider.cs

@ -2,7 +2,7 @@
public interface IWebClientInfoProvider
{
string BrowserInfo { get; }
string? BrowserInfo { get; }
string ClientIpAddress { get; }
string? ClientIpAddress { get; }
}

3
framework/src/Volo.Abp.AspNetCore/Volo/Abp/ServiceProviderAccessorExtensions.cs

@ -7,8 +7,7 @@ namespace Volo.Abp;
public static class ServiceProviderAccessorExtensions
{
[CanBeNull]
public static HttpContext GetHttpContext(this IServiceProviderAccessor serviceProviderAccessor)
public static HttpContext? GetHttpContext(this IServiceProviderAccessor serviceProviderAccessor)
{
return serviceProviderAccessor.ServiceProvider.GetRequiredService<IHttpContextAccessor>().HttpContext;
}

4
framework/src/Volo.Abp.RemoteServices/Volo/Abp/Http/Client/RemoteServiceConfiguration.cs

@ -7,8 +7,8 @@ public class RemoteServiceConfiguration : Dictionary<string, string?>
/// <summary>
/// Base Url.
/// </summary>
public string? BaseUrl {
get => this.GetOrDefault(nameof(BaseUrl));
public string BaseUrl {
get => this.GetOrDefault(nameof(BaseUrl))!;
set => this[nameof(BaseUrl)] = value;
}

4
framework/src/Volo.Abp.UI/Volo/Abp/Ui/LayoutHooks/LayoutHookViewModel.cs

@ -4,9 +4,9 @@ public class LayoutHookViewModel
{
public LayoutHookInfo[] Hooks { get; }
public string Layout { get; }
public string? Layout { get; }
public LayoutHookViewModel(LayoutHookInfo[] hooks, string layout)
public LayoutHookViewModel(LayoutHookInfo[] hooks, string? layout)
{
Hooks = hooks;
Layout = layout;

Loading…
Cancel
Save