");
+ });
+ });
+});
+```
+
+Now, we can run the application and see the Image Manipulation System in action:
+
+
+
+The results are impressive for the example above:
+
+* The original image was 12 KB and now the compressed & resized image has been reduced to 8 KB.
+* The original image was 225x225 and now resized as 200x200.
+
+## Conclusion
+
+In this article, I have shown you how to compress and/or resize images with ABP Framework's Image Manipulation System by just defining some attributes to the top of the controller actions.
+
+Also, I have shown that you can use the BLOB Storing System to store file contents and compress/resize images before saving them into BLOB Storages thanks to the image resizers/compressors provided by ABP Framework.
+
+## See Also
+
+* [BLOB Storing](https://docs.abp.io/en/abp/latest/Blob-Storing)
+* [Image Manipulation](https://docs.abp.io/en/abp/7.3/Image-Manipulation#iimageresizer)
diff --git a/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-manipulation.gif b/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-manipulation.gif
new file mode 100644
index 0000000000..d8b2a10c16
Binary files /dev/null and b/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-manipulation.gif differ
diff --git a/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-upload-ui.png b/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-upload-ui.png
new file mode 100644
index 0000000000..d5fab5a945
Binary files /dev/null and b/docs/en/Community-Articles/2023-07-03-Image-Compression-And-Resize/image-upload-ui.png differ
diff --git a/docs/en/Integration-Services.md b/docs/en/Integration-Services.md
index e788c348f7..98e3e593e5 100644
--- a/docs/en/Integration-Services.md
+++ b/docs/en/Integration-Services.md
@@ -34,11 +34,47 @@ public interface IProductAppService : IApplicationService
That's all. From now, ABP will handle your application service as integration service and implement the followings by convention:
-* If you are using the [Auto API Controllers](API/Auto-API-Controllers.md) feature in your application, the URL prefix will be `/integration-api` instead of `/api` for your integration services. Thus, you can distinguish internal and external service communications and take additional actions, such as preventing REST API calls for integration services out of API Gateway.
-* Audit logging is disabled by default for the integration services. See the next section if you want to enable it.
+* That service is **not exposed** by default, unless you explicitly set `ExposeIntegrationServices` options (see the *Exposing Integration Services* section).
+* If you are using the [Auto API Controllers](API/Auto-API-Controllers.md) feature in your application, the **URL prefix** will be `/integration-api` instead of `/api` for your integration services. Thus, you can distinguish internal and external service communications and take additional actions, such as preventing REST API calls for integration services out of API Gateway.
+* **Audit logging** is disabled by default for the integration services. See the next section if you want to enable it.
+
+## Marking an MVC Controller as Integration Service
+
+In addition to application services, you can mark a regular MVC Controller as integration service, using the same `IntegrationService` attribute, or inheriting an interface that has the `IntegrationService` attribute.
+
+**Example:**
+
+````csharp
+[IntegrationService] // Mark as integration service
+[Route("integration-api/products")]
+public class ProductController : AbpControllerBase
+{
+ //...
+}
+````
+
+When you use the `IntegrationService` attribute, ABP will handle your controller as integration service and implement the followings by convention:
+
+* That controller is **not exposed** to clients by default, unless you explicitly set `ExposeIntegrationServices` options (see the *Exposing Integration Services* section).
+* **Audit logging** is disabled by default for controller. See the next section if you want to enable it.
## Configuration
+### Exposing Integration Services
+
+Integration services and controllers are not exposed by default for security reasons. They typically don't require authorization, so you should **carefully and explicitly** allow them to be visible and usable to client applications.
+
+To expose integration services and controllers, set `AbpAspNetCoreMvcOptions.ExposeIntegrationServices` to `true` in the `ConfigureServices` method of your [module class](Module-Development-Basics.md):
+
+````csharp
+Configure(options =>
+{
+ options.ExposeIntegrationServices = true;
+});
+````
+
+> Hiding integration services is useful when you are building reusable application modules, where they may be used in a monolith application or in a microservice system. In a monolith application, integration services don't need to be exposed outside since the modules may in-process communicate with each other. On the other hand, if you build a microservice solution and use that module as a service, it will be proper to expose the integration services, so other microservices can consume them remotely inside your private network (or Kubernetes cluster). In that case, be careful to not accidently expose the integration services out of your private network. Configuring your API Gateway so that it blocks requests to `integration-api` prefixed URLs from outside of your network will be a good option.
+
### Enabling/Disabling the Audit Logging
Audit Logging is disabled by default for integration services but it can be enabled by configuring the `AbpAuditingOptions` [options class](Options.md) in the `ConfigureServices` method of your [module class](Module-Development-Basics.md):
diff --git a/docs/en/Migration-Guides/docs/en/Migration-Guides/Abp-7_4.md b/docs/en/Migration-Guides/docs/en/Migration-Guides/Abp-7_4.md
new file mode 100644
index 0000000000..5ec8eb6c65
--- /dev/null
+++ b/docs/en/Migration-Guides/docs/en/Migration-Guides/Abp-7_4.md
@@ -0,0 +1,8 @@
+# ABP Version 7.4 Migration Guide
+
+This document is a guide for upgrading ABP v7.3 solutions to ABP v7.4. There are a few changes in this version that may affect your applications, please read it carefully and apply the necessary changes to your application.
+
+## TemplateDefinition
+
+The `LocalizationResource(Type)` of `TemplateDefinition` class is changed to `LocalizationResourceName(string)`.
+
diff --git a/docs/en/Module-Development-Basics.md b/docs/en/Module-Development-Basics.md
index dfce0bf4b2..1fdd09f8b2 100644
--- a/docs/en/Module-Development-Basics.md
+++ b/docs/en/Module-Development-Basics.md
@@ -147,7 +147,7 @@ Lastly, you can override ``OnApplicationShutdown`` method if you want to execute
## Module Dependencies
-In a modular application, it's not unusual for one module to depend upon another module(s). An Abp module must declare ``[DependsOn]`` attribute if it does have a dependency upon another module, as shown below:
+In a modular application, it's not unusual for one module to depend upon another module(s). An ABP module must declare a ``[DependsOn]`` attribute if it does have a dependency upon another module, as shown below:
````C#
[DependsOn(typeof(AbpAspNetCoreMvcModule))]
@@ -162,6 +162,27 @@ You can use multiple ``DependsOn`` attribute or pass multiple module types to a
A depended module may depend on another module, but you only need to define your direct dependencies. ABP investigates the dependency graph for the application at startup and initializes/shutdowns modules in the correct order.
+## Additional Module Assemblies
+
+ABP automatically registers all the services of your module to the [dependency injection](Dependency-Injection.md) system. It finds the service types by scanning types in the assembly that defines your module class. That assembly is considered as the main assembly of your module.
+
+Typically, every assembly contains a separate module class definition. Then modules depend on each other using the `DependsOn` attribute as explained in the previous section. However, in some rare cases, your module may consist of multiple assemblies, and only one of them defines a module class, and you want to make the other assemblies parts of your module. In that case, you can use the `AdditionalAssembly` attribute as shown below:
+
+````csharp
+[DependsOn(...)] // Your module dependencies as you normally do
+[AdditionalAssembly(typeof(BlogService))] // A type in the target assembly
+public class BlogModule
+{
+ //...
+}
+````
+
+In this example, we assume that the `BlogService` class is inside one assembly (`csproj`) and the `BlogModule` class is inside another assembly (`csproj`). With the `AdditionalAssembly` definition, ABP will load the assembly containing the `BlogService` class as a part of the blog module.
+
+Notice that `BlogService` is only an arbitrary selected type in the target assembly. It is just used to indicate the related assembly. You could use any type in the assembly.
+
+> WARNING: If you need to use the `AdditionalAssembly`, be sure that you don't design your system in a wrong way. With this example above, the `BlogService` class' assembly should normally have its own module class and the `BlogModule` should depend on it using the `DependsOn` attribute. Do not use the `AdditionalAssembly` attribute when you can already use the `DependsOn` attribute.
+
## Framework Modules vs Application Modules
There are **two types of modules.** They don't have any structural difference but categorized by functionality and purpose:
diff --git a/docs/en/Module-Entity-Extensions.md b/docs/en/Module-Entity-Extensions.md
index 47436a7dd9..93c79120cd 100644
--- a/docs/en/Module-Entity-Extensions.md
+++ b/docs/en/Module-Entity-Extensions.md
@@ -255,6 +255,20 @@ property =>
Use `property.UI.OnCreateForm` and `property.UI.OnEditForm` to control forms too. If a property is required, but not added to the create form, you definitely get a validation exception, so use this option carefully. But a required property may not be in the edit form if that's your requirement.
+### UI Order
+
+When you define a property, it appears on the data table, create and edit forms on the related UI page. However, you can control its order. Example:
+
+````csharp
+property =>
+{
+ property.UI.Order = 1;
+ //...other configurations
+}
+````
+
+Use `property.UI.OnCreateForm` and `property.UI.OnEditForm` to control forms too. If a property is required, but not added to the create form, you definitely get a validation exception, so use this option carefully. But a required property may not be in the edit form if that's your requirement.
+
### HTTP API Availability
Even if you disable a property on UI, it can be still available through the HTTP API. By default, a property is available on all APIs.
diff --git a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
index 038e852f21..2924448609 100644
--- a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
+++ b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo.Abp.ApiVersioning.Abstractions.csproj
@@ -5,6 +5,8 @@
netstandard2.0;netstandard2.1;net7.0
+ enable
+ NullableVolo.Abp.ApiVersioning.AbstractionsVolo.Abp.ApiVersioning.Abstractions$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/IRequestedApiVersion.cs b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/IRequestedApiVersion.cs
index 96c2ef33cd..428f8bb6c0 100644
--- a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/IRequestedApiVersion.cs
+++ b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/IRequestedApiVersion.cs
@@ -2,5 +2,5 @@
public interface IRequestedApiVersion
{
- string Current { get; }
+ string? Current { get; }
}
diff --git a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/NullRequestedApiVersion.cs b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/NullRequestedApiVersion.cs
index 0589c662ef..6099283cc4 100644
--- a/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/NullRequestedApiVersion.cs
+++ b/framework/src/Volo.Abp.ApiVersioning.Abstractions/Volo/Abp/ApiVersioning/NullRequestedApiVersion.cs
@@ -4,7 +4,7 @@ public class NullRequestedApiVersion : IRequestedApiVersion
{
public static NullRequestedApiVersion Instance = new NullRequestedApiVersion();
- public string Current => null;
+ public string? Current => null;
private NullRequestedApiVersion()
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
index bfe8b1d37b..6deeaac7e3 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo.Abp.AspNetCore.Authentication.JwtBearer.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ NullableVolo.Abp.AspNetCore.Authentication.JwtBearerVolo.Abp.AspNetCore.Authentication.JwtBearer$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj
index 562e559273..f8efe3c11c 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo.Abp.AspNetCore.Authentication.OAuth.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ NullableVolo.Abp.AspNetCore.Authentication.OAuthVolo.Abp.AspNetCore.Authentication.OAuth$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs
index 1910af63d5..e058303572 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Volo/Abp/AspNetCore/Authentication/OAuth/Claims/MultipleClaimAction.cs
@@ -29,7 +29,7 @@ public class MultipleClaimAction : ClaimAction
switch (prop.ValueKind)
{
case JsonValueKind.String:
- claim = new Claim(ClaimType, prop.GetString(), ValueType, issuer);
+ claim = new Claim(ClaimType, prop.GetString()!, ValueType, issuer);
if (!identity.Claims.Any(c => c.Type == claim.Type && c.Value == claim.Value))
{
identity.AddClaim(claim);
@@ -38,7 +38,7 @@ public class MultipleClaimAction : ClaimAction
case JsonValueKind.Array:
foreach (var arramItem in prop.EnumerateArray())
{
- claim = new Claim(ClaimType, arramItem.GetString(), ValueType, issuer);
+ claim = new Claim(ClaimType, arramItem.GetString()!, ValueType, issuer);
if (!identity.Claims.Any(c => c.Type == claim.Type && c.Value == claim.Value))
{
identity.AddClaim(claim);
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs
index 2a2d0a712d..7d2c1fe6d6 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Microsoft/Extensions/DependencyInjection/AbpOpenIdConnectExtensions.cs
@@ -28,8 +28,6 @@ public static class AbpOpenIdConnectExtensions
{
options.ClaimActions.MapAbpClaimTypes();
- configureOptions?.Invoke(options);
-
options.Events ??= new OpenIdConnectEvents();
var authorizationCodeReceived = options.Events.OnAuthorizationCodeReceived ?? (_ => Task.CompletedTask);
@@ -39,16 +37,7 @@ public static class AbpOpenIdConnectExtensions
return authorizationCodeReceived.Invoke(receivedContext);
};
- options.Events.OnRemoteFailure = remoteFailureContext =>
- {
- if (remoteFailureContext.Failure is OpenIdConnectProtocolException &&
- remoteFailureContext.Failure.Message.Contains("access_denied"))
- {
- remoteFailureContext.HandleResponse();
- remoteFailureContext.Response.Redirect($"{remoteFailureContext.Request.PathBase}/");
- }
- return Task.CompletedTask;
- };
+ options.AccessDeniedPath = "/";
options.Events.OnTokenValidated = async (context) =>
{
@@ -63,6 +52,8 @@ public static class AbpOpenIdConnectExtensions
logger?.LogException(ex);
}
};
+
+ configureOptions?.Invoke(options);
});
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
index 9f1051fbd5..9fa50a203f 100644
--- a/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OpenIdConnect/Volo.Abp.AspNetCore.Authentication.OpenIdConnect.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ Nullable
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj
index bc6b5fdb26..3cd049965e 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming/Volo.Abp.AspNetCore.Components.MauiBlazor.Theming.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ Nullable
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj
index b1b9dcde81..ff80cd1fba 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo.Abp.AspNetCore.Components.MauiBlazor.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ NullableVolo.Abp.AspNetCore.Components.MauiBlazorVolo.Abp.AspNetCore.Components.MauiBlazor$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpAspNetCoreComponentsMauiBlazorModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpAspNetCoreComponentsMauiBlazorModule.cs
index 9772db6a92..010bad5db2 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpAspNetCoreComponentsMauiBlazorModule.cs
+++ b/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;
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpMauiBlazorClientHttpMessageHandler.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpMauiBlazorClientHttpMessageHandler.cs
index 90471ba6b4..9fb31979ac 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/AbpMauiBlazorClientHttpMessageHandler.cs
+++ b/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!));
}
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/ApplicationConfigurationCache.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/ApplicationConfigurationCache.cs
index a50c25824e..b5ca46e7d8 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/ApplicationConfigurationCache.cs
+++ b/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;
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/IMauiBlazorSelectedLanguageProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/IMauiBlazorSelectedLanguageProvider.cs
index c6b4722f58..f995f79a83 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/IMauiBlazorSelectedLanguageProvider.cs
+++ b/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 GetSelectedLanguageAsync();
+ Task GetSelectedLanguageAsync();
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorCurrentTenantAccessor.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorCurrentTenantAccessor.cs
index 9fa7ad03ca..230bd06929 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorCurrentTenantAccessor.cs
+++ b/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; }
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorRemoteTenantStore.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorRemoteTenantStore.cs
index 3cace3f113..235fe74354 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorRemoteTenantStore.cs
+++ b/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 FindAsync(string name)
+ public async Task 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 FindAsync(Guid id)
+ public async Task 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)
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorServerUrlProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorServerUrlProvider.cs
index 1204bfb99b..a93472d3b8 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/MauiBlazorServerUrlProvider.cs
+++ b/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 GetBaseUrlAsync(string remoteServiceName = null)
+ public async Task GetBaseUrlAsync(string? remoteServiceName = null)
{
var remoteServiceConfiguration = await RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(
remoteServiceName ?? RemoteServiceConfigurationDictionary.DefaultName
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/NullMauiBlazorSelectedLanguageProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/NullMauiBlazorSelectedLanguageProvider.cs
index b617b96da4..4f1d0504ca 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.MauiBlazor/Volo/Abp/AspNetCore/Components/MauiBlazor/NullMauiBlazorSelectedLanguageProvider.cs
+++ b/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 GetSelectedLanguageAsync()
+ public Task GetSelectedLanguageAsync()
{
- return Task.FromResult((string)null);
+ return Task.FromResult((string?)null);
}
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj
index c632120d73..266831eba9 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Volo.Abp.AspNetCore.Components.Server.Theming.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ NullabletrueLibrarytrue
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs
index 48065bbac2..ba542312d1 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs
+++ b/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
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj
index 297b2a8576..a8cb372ddc 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ NullabletrueLibrarytrue
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs
index 355f9fff44..00a5086031 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Extensibility/BlazorServerLookupApiRequestService.cs
+++ b/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());
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/DynamicLayoutComponent.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/DynamicLayoutComponent.razor.cs
index 3c4d68178e..4363b674c0 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/DynamicLayoutComponent.razor.cs
+++ b/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 { get; set; }
+ protected IOptions AbpDynamicLayoutComponentOptions { get; set; } = default!;
}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs
index 729b990f34..f5ce191f20 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Components/LayoutHooks/LayoutHook.razor.cs
+++ b/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 LayoutHookOptions { get; set; }
+ protected IOptions LayoutHookOptions { get; set; } = default!;
- protected LayoutHookViewModel LayoutHookViewModel { get; private set; }
+ protected LayoutHookViewModel LayoutHookViewModel { get; private set; } = default!;
protected override Task OnInitializedAsync()
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
index ea0b810765..91485d5bf8 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
@@ -13,13 +13,13 @@ public partial class PageHeader : ComponentBase
{
protected List 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 BreadcrumbItems {
@@ -44,7 +44,7 @@ public partial class PageHeader : ComponentBase
}
[Parameter]
- public PageToolbar Toolbar { get; set; }
+ public PageToolbar? Toolbar { get; set; }
public PageHeader()
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs
index 4d04bd2ad7..077ca5b32c 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs
+++ b/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 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));
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs
index 9d9448d281..673c004fdb 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarExtensions.cs
@@ -11,9 +11,9 @@ public static class PageToolbarExtensions
{
public static PageToolbar AddComponent(
this PageToolbar toolbar,
- Dictionary arguments = null,
+ Dictionary? 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 arguments = null,
+ Dictionary? 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 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(
- new Dictionary
+ new Dictionary
{
{ nameof(ToolbarButton.Color), color ?? Color.Primary},
{ nameof(ToolbarButton.Text), text},
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarItem.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarItem.cs
index f62d770403..3e38fb9b1a 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/PageToolbarItem.cs
+++ b/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 Arguments { get; set; }
+ public Dictionary? Arguments { get; set; }
public int Order { get; set; }
public PageToolbarItem(
[NotNull] Type componentType,
- [CanBeNull] Dictionary arguments = null,
+ Dictionary? arguments = null,
int order = 0)
{
ComponentType = Check.NotNull(componentType, nameof(componentType));
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/SimplePageToolbarContributor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/SimplePageToolbarContributor.cs
index d31b12e73c..647538c121 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/PageToolbars/SimplePageToolbarContributor.cs
+++ b/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 Arguments { get; set; }
+ public Dictionary? Arguments { get; set; }
public int Order { get; }
- public string RequiredPolicyName { get; }
+ public string? RequiredPolicyName { get; }
public SimplePageToolbarContributor(
Type componentType,
- Dictionary arguments = null,
+ Dictionary? arguments = null,
int order = 0,
- string requiredPolicyName = null)
+ string? requiredPolicyName = null)
{
ComponentType = componentType;
Arguments = arguments;
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Routing/AbpRouterOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Routing/AbpRouterOptions.cs
index ce3b2746e4..9c21e9485d 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Routing/AbpRouterOptions.cs
+++ b/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; }
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/AbpThemingOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/AbpThemingOptions.cs
index 6bba37e0f8..71b0d8bb35 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/AbpThemingOptions.cs
+++ b/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()
{
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/DefaultThemeManager.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/DefaultThemeManager.cs
index c85a25bf19..5abd114f83 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Theming/DefaultThemeManager.cs
+++ b/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; }
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs
index e2bfaf06d0..23c565eb5f 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/IToolbarConfigurationContext.cs
@@ -17,8 +17,7 @@ public interface IToolbarConfigurationContext : IServiceProviderAccessor
Task IsGrantedAsync(string policyName);
- [CanBeNull]
- IStringLocalizer GetDefaultLocalizer();
+ IStringLocalizer? GetDefaultLocalizer();
[NotNull]
public IStringLocalizer GetLocalizer();
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarConfigurationContext.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarConfigurationContext.cs
index f773ba14e1..7870743851 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarConfigurationContext.cs
+++ b/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();
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarItem.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarItem.cs
index 966145a4ee..32816d7a3b 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Toolbars/ToolbarItem.cs
+++ b/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; }
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj
index d0abc31cdc..1dd5b61131 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Volo.Abp.AspNetCore.Components.Web.Theming.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ Nullable
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj
index bc975f9f92..7f89d1c254 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo.Abp.AspNetCore.Components.Web.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ Nullable
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorClientHttpMessageHandler.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorClientHttpMessageHandler.cs
index eb8bee99bd..c92c121628 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorClientHttpMessageHandler.cs
+++ b/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;
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs
index 52efbc6d11..dc0a2182cb 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpBlazorMessageLocalizerHelper.cs
@@ -14,12 +14,12 @@ public class AbpBlazorMessageLocalizerHelper
this.stringLocalizer = stringLocalizer;
}
- public string Localize(string message, [CanBeNull] IEnumerable arguments)
+ public string Localize(string message, IEnumerable? arguments)
{
try
{
return arguments?.Count() > 0
- ? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()]
+ ? stringLocalizer[message, LocalizeMessageArguments(arguments)?.ToArray()!]
: stringLocalizer[message];
}
catch
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieOptions.cs
index 283f665642..d8a5ec3a1a 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieOptions.cs
+++ b/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; }
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieService.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieService.cs
index 1b61acb459..a3868d5b2e 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/CookieService.cs
+++ b/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("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);
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DefaultServerUrlProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DefaultServerUrlProvider.cs
index 281ee3cd73..aae5f1f98b 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DefaultServerUrlProvider.cs
+++ b/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 GetBaseUrlAsync(string remoteServiceName = null)
+ public Task GetBaseUrlAsync(string? remoteServiceName = null)
{
return Task.FromResult("/");
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs
index f5e07865a7..2311a2c9f9 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs
+++ b/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!;
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger.cs
index cf66f107a0..ba56233ec5 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger.cs
+++ b/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 formatter)
{
if (exception == null)
@@ -58,7 +58,7 @@ public class AbpExceptionHandlingLogger : ILogger
return logLevel == LogLevel.Critical || logLevel == LogLevel.Error;
}
- public virtual IDisposable BeginScope(TState state)
+ public virtual IDisposable? BeginScope(TState state) where TState : notnull
{
return NullDisposable.Instance;
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLoggerProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLoggerProvider.cs
index 3f895502fa..d13fd5a751 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLoggerProvider.cs
+++ b/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;
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs
index 0f0da11bdf..6773e4ff37 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/UserExceptionInformer.cs
+++ b/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);
}
}
diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs
index 837eb2c96a..56bcf3d543 100644
--- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/EntityActions/EntityAction.cs
+++ b/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
{
- public string Text { get; set; }
- public Func