Browse Source

Merge branch 'dev' into net10.0

pull/23609/head
maliming 5 months ago
parent
commit
019cf1e4ec
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 5
      Directory.Packages.props
  2. 307
      docs/en/framework/infrastructure/artificial-intelligence.md
  3. 1
      docs/en/framework/infrastructure/index.md
  4. 262
      docs/en/framework/ui/react-native/index.md
  5. 127
      docs/en/framework/ui/react-native/setting-up-android-emulator.md
  6. BIN
      docs/en/get-started/images/abp-studio-mobile-sample.gif
  7. 5
      docs/en/get-started/layered-web-application.md
  8. BIN
      docs/en/images/author-input-in-book-form.png
  9. BIN
      docs/en/images/author-list-with-options.png
  10. BIN
      docs/en/images/author-list.png
  11. BIN
      docs/en/images/authors-in-book-form.png
  12. BIN
      docs/en/images/book-list-with-author.png
  13. BIN
      docs/en/images/book-list-with-options.png
  14. BIN
      docs/en/images/book-list.png
  15. BIN
      docs/en/images/book-store-menu-item.png
  16. BIN
      docs/en/images/books-menu-item.png
  17. BIN
      docs/en/images/create-author.png
  18. BIN
      docs/en/images/create-book-button-visibility.png
  19. BIN
      docs/en/images/create-book-icon.png
  20. BIN
      docs/en/images/create-book.png
  21. BIN
      docs/en/images/delete-author-alert.png
  22. BIN
      docs/en/images/delete-book-alert.png
  23. BIN
      docs/en/images/delete-book.png
  24. BIN
      docs/en/images/react-native-environment-local-ip.png
  25. BIN
      docs/en/images/react-native-introduction.gif
  26. BIN
      docs/en/images/react-native-microservice-be-config.png
  27. BIN
      docs/en/images/react-native-monolith-be-config.png
  28. BIN
      docs/en/images/react-native-monolith-environment-local-ip.png
  29. BIN
      docs/en/images/react-native-option.png
  30. BIN
      docs/en/images/react-native-store-folder.png
  31. BIN
      docs/en/images/react-native-tiered-be-config.png
  32. BIN
      docs/en/images/react-native-tiered-environment-local-ip.png
  33. BIN
      docs/en/images/rn-login-android-studio.png
  34. BIN
      docs/en/images/rn-login-iphone.png
  35. BIN
      docs/en/images/update-author.png
  36. BIN
      docs/en/images/update-book.png
  37. BIN
      docs/en/images/update-delete-book-button-visibility.png
  38. 10
      docs/en/solution-templates/layered-web-application/mobile-applications.md
  39. 22
      docs/en/solution-templates/microservice/mobile-applications.md
  40. 8
      docs/en/suite/solution-structure.md
  41. 963
      docs/en/tutorials/mobile/react-native/index.md
  42. 1
      framework/Volo.Abp.sln.DotSettings
  43. 8
      framework/Volo.Abp.slnx
  44. 3
      framework/src/Volo.Abp.AI.Abstractions/FodyWeavers.xml
  45. 30
      framework/src/Volo.Abp.AI.Abstractions/FodyWeavers.xsd
  46. 3
      framework/src/Volo.Abp.AI.Abstractions/Volo.Abp.AI.Abstractions.abppkg
  47. 26
      framework/src/Volo.Abp.AI.Abstractions/Volo.Abp.AI.Abstractions.csproj
  48. 10
      framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/AbpAIAbstractionsModule.cs
  49. 8
      framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/IChatClient.cs
  50. 14
      framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/IKernelAccessor.cs
  51. 38
      framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/WorkspaceNameAttribute.cs
  52. 3
      framework/src/Volo.Abp.AI/FodyWeavers.xml
  53. 30
      framework/src/Volo.Abp.AI/FodyWeavers.xsd
  54. 3
      framework/src/Volo.Abp.AI/Volo.Abp.AI.abppkg
  55. 27
      framework/src/Volo.Abp.AI/Volo.Abp.AI.csproj
  56. 96
      framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIModule.cs
  57. 19
      framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs
  58. 8
      framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIWorkspaceOptions.cs
  59. 8
      framework/src/Volo.Abp.AI/Volo/Abp/AI/BuilderConfigurerList.cs
  60. 23
      framework/src/Volo.Abp.AI/Volo/Abp/AI/ChatClientConfiguration.cs
  61. 18
      framework/src/Volo.Abp.AI/Volo/Abp/AI/DefaultKernelAccessor.cs
  62. 9
      framework/src/Volo.Abp.AI/Volo/Abp/AI/KernelBuilderConfigurerList.cs
  63. 21
      framework/src/Volo.Abp.AI/Volo/Abp/AI/KernelConfiguration.cs
  64. 18
      framework/src/Volo.Abp.AI/Volo/Abp/AI/TypedChatClient.cs
  65. 20
      framework/src/Volo.Abp.AI/Volo/Abp/AI/TypedKernelAccessor.cs
  66. 28
      framework/src/Volo.Abp.AI/Volo/Abp/AI/WorkspaceConfiguration.cs
  67. 29
      framework/src/Volo.Abp.AI/Volo/Abp/AI/WorkspaceConfigurationDictionary.cs
  68. 10
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs
  69. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs
  70. 14
      framework/src/Volo.Abp.Core/Volo/Abp/Collections/NamedActionList.cs
  71. 9
      framework/src/Volo.Abp.Core/Volo/Abp/Collections/NamedObjectList.cs
  72. 14
      framework/src/Volo.Abp.Core/Volo/Abp/NamedAction.cs
  73. 11
      framework/src/Volo.Abp.Core/Volo/Abp/NamedObject.cs
  74. 11
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs
  75. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ar.json
  76. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/cs.json
  77. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/de.json
  78. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/el.json
  79. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/en-GB.json
  80. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/en.json
  81. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/es.json
  82. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fa.json
  83. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fi.json
  84. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fr.json
  85. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hi.json
  86. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hr.json
  87. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hu.json
  88. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/is.json
  89. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/it.json
  90. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/nl.json
  91. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/pl-PL.json
  92. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/pt-BR.json
  93. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ro-RO.json
  94. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ru.json
  95. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sk.json
  96. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sl.json
  97. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sv.json
  98. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/tr.json
  99. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/vi.json
  100. 1
      framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/zh-Hans.json

5
Directory.Packages.props

@ -88,6 +88,11 @@
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0-rc.*" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0-rc.*" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0-rc.*" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0-rc.*" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.7.1" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.7.1" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.61.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Abstractions" Version="1.61.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Hybrid" Version="9.9.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0-rc.*" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.0-rc.*" />

307
docs/en/framework/infrastructure/artificial-intelligence.md

@ -0,0 +1,307 @@
# Artificial Intelligence
ABP provides a simple way to integrate AI capabilities into your applications by unifying two popular .NET AI stacks under a common concept called a "workspace":
- Microsoft.Extensions.AI `IChatClient`
- Microsoft.SemanticKernel `Kernel`
A workspace is just a named scope. You configure providers per workspace and then resolve either default services (for the "Default" workspace) or workspace-scoped services.
## Installation
> This package is not included by default. Install it to enable AI features.
It is suggested to use the ABP CLI to install the package. Open a command line window in the folder of the project (.csproj file) and type the following command:
```bash
abp add-package Volo.Abp.AI
```
### Manual Installation
Add nuget package to your project:
```bash
dotnet add package Volo.Abp.AI
```
Then add the module dependency to your module class:
```csharp
using Volo.Abp.AI;
using Volo.Abp.Modularity;
[DependsOn(typeof(AbpAIModule))]
public class MyProjectModule : AbpModule
{
}
```
## Usage
### Chat Client
#### Default configuration (quick start)
Configure the default workspace to inject `IChatClient` directly.
```csharp
using Microsoft.Extensions.AI;
using Microsoft.SemanticKernel;
using Volo.Abp.AI;
using Volo.Abp.Modularity;
public class MyProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpAIOptions>(options =>
{
options.Workspaces.ConfigureDefault(configuration =>
{
configuration.ConfigureChatClient(chatClientConfiguration =>
{
chatClientConfiguration.Builder = new ChatClientBuilder(
sp => new OllamaApiClient("http://localhost:11434", "mistral")
);
});
// Chat client only in this quick start
});
});
}
}
```
Once configured, inject the default chat client:
```csharp
using Microsoft.Extensions.AI;
public class MyService
{
private readonly IChatClient _chatClient; // default chat client
public MyService(IChatClient chatClient)
{
_chatClient = chatClient;
}
}
```
#### Workspace configuration
Workspaces allow multiple, isolated AI configurations. Define workspace types (optionally decorated with `WorkspaceNameAttribute`). If omitted, the type’s full name is used.
```csharp
using Volo.Abp.AI;
[WorkspaceName("GreetingAssistant")]
public class GreetingAssistant // ChatClient-only workspace
{
}
```
Configure a ChatClient workspace:
```csharp
public class MyProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpAIOptions>(options =>
{
options.Workspaces.Configure<GreetingAssistant>(configuration =>
{
configuration.ConfigureChatClient(chatClientConfiguration =>
{
chatClientConfiguration.Builder = new ChatClientBuilder(
sp => new OllamaApiClient("http://localhost:11434", "mistral")
);
chatClientConfiguration.BuilderConfigurers.Add(builder =>
{
// Anything you want to do with the builder:
// builder.UseFunctionInvocation().UseLogging(); // For example
});
});
});
});
}
}
```
### Semantic Kernel
#### Default configuration
```csharp
public class MyProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpAIOptions>(options =>
{
options.Workspaces.ConfigureDefault(configuration =>
{
configuration.ConfigureKernel(kernelConfiguration =>
{
kernelConfiguration.Builder = Kernel.CreateBuilder()
.AddAzureOpenAIChatClient("...", "...");
});
// Note: Chat client is not configured here
});
});
}
}
```
Once configured, inject the default kernel:
```csharp
using System.Threading.Tasks;
using Volo.Abp.AI;
public class MyService
{
private readonly IKernelAccessor _kernelAccessor;
public MyService(IKernelAccessor kernelAccessor)
{
_kernelAccessor = kernelAccessor;
}
public async Task DoSomethingAsync()
{
var kernel = _kernelAccessor.Kernel; // Kernel might be null if no workspace is configured.
var result = await kernel.InvokeAsync(/*... */);
}
}
```
#### Workspace configuration
```csharp
public class MyProjectModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<AbpAIOptions>(options =>
{
options.Workspaces.Configure<ContentPlanner>(configuration =>
{
configuration.ConfigureKernel(kernelConfiguration =>
{
kernelConfiguration.Builder = Kernel.CreateBuilder()
.AddOpenAIChatCompletion("...", "...");
});
});
});
}
}
```
#### Workspace usage
```csharp
using Microsoft.Extensions.AI;
using Volo.Abp.AI;
using Microsoft.SemanticKernel;
public class PlanningService
{
private readonly IKernelAccessor<ContentPlanner> _kernelAccessor;
private readonly IChatClient<ContentPlanner> _chatClient; // available even if only Kernel is configured
public PlanningService(
IKernelAccessor<ContentPlanner> kernelAccessor,
IChatClient<ContentPlanner> chatClient)
{
_kernelAccessor = kernelAccessor;
_chatClient = chatClient;
}
public async Task<string> PlanAsync(string topic)
{
var kernel = _kernelAccessor.Kernel; // Microsoft.SemanticKernel.Kernel
// Use Semantic Kernel APIs if needed...
var response = await _chatClient.GetResponseAsync(
[new ChatMessage(ChatRole.User, $"Create a content plan for: {topic}")]
);
return response?.Message?.Text ?? string.Empty;
}
}
```
## Options
`AbpAIOptions` configuration pattern offers `ConfigureChatClient(...)` and `ConfigureKernel(...)` methods for configuration. These methods are defined in the `WorkspaceConfiguration` class. They are used to configure the `ChatClient` and `Kernel` respectively.
`Builder` is set once and is used to build the `ChatClient` or `Kernel` instance. `BuilderConfigurers` is a list of actions that are applied to the `Builder` instance for incremental changes. These actions are executed in the order they are added.
If a workspace configures only the Kernel, a chat client may still be exposed for that workspace through the Kernel’s service provider (when available).
## Advanced Usage and Customizations
### Addding Your Own DelegatingChatClient
If you want to build your own decorator, implement a `DelegatingChatClient` derivative and provide an extension method that adds it to the `ChatClientBuilder` using `builder.Use(...)`.
Example sketch:
```csharp
using Microsoft.Extensions.AI;
public class SystemMessageChatClient : DelegatingChatClient
{
public SystemMessageChatClient(IChatClient inner, string systemMessage) : base(inner)
{
SystemMessage = systemMessage;
}
public string SystemMessage { get; set; }
public override Task<ChatResponse> GetResponseAsync(IEnumerable<ChatMessage> messages, ChatOptions? options = null, CancellationToken cancellationToken = default)
{
// Mutate messages/options as needed, then call base
return base.GetResponseAsync(messages, options, cancellationToken);
}
}
public static class SystemMessageChatClientExtensions
{
public static ChatClientBuilder UseSystemMessage(this ChatClientBuilder builder, string systemMessage)
{
return builder.Use(client => new SystemMessageChatClient(client, systemMessage));
}
}
```
```cs
chatClientConfiguration.BuilderConfigurers.Add(builder =>
{
builder.UseSystemMessage("You are a helpful assistant that greets users in a friendly manner with their names.");
});
```
## Technical Anatomy
- `AbpAIModule`: Wires up configured workspaces, registers keyed services and default services for the `"Default"` workspace.
- `AbpAIOptions`: Holds `Workspaces` and provides helper methods for internal keyed service naming.
- `WorkspaceConfigurationDictionary` and `WorkspaceConfiguration`: Configure per-workspace Chat Client and Kernel.
- `ChatClientConfiguration` and `KernelConfiguration`: Hold builders and a list of ordered builder configurers.
- `WorkspaceNameAttribute`: Names a workspace; falls back to the type’s full name if not specified.
- `IChatClient<TWorkspace>`: Typed chat client for a workspace.
- `IKernelAccessor<TWorkspace>`: Provides access to the workspace’s `Kernel` instance if configured.
- `AbpAIWorkspaceOptions`: Exposes `ConfiguredWorkspaceNames` for diagnostics.
There are no database tables for this feature; it is a pure configuration and DI integration layer.
## See Also
- Microsoft.Extensions.AI (Chat Client)
- Microsoft Semantic Kernel

1
docs/en/framework/infrastructure/index.md

@ -3,6 +3,7 @@
ABP provides a complete infrastructure for creating real world software solutions with modern architectures based on the .NET platform. Each of the following documents explains an infrastructure feature:
* [Audit Logging](./audit-logging.md)
* [Artificial Intelligence](./artificial-intelligence.md)
* [Background Jobs](./background-jobs/index.md)
* [Background Workers](./background-workers/index.md)
* [BLOB Storing](./blob-storing/index.md)

262
docs/en/framework/ui/react-native/index.md

@ -1,7 +1,7 @@
````json
//[doc-params]
{
"Tiered": ["No", "Yes"]
"Architecture": ["Monolith", "Tiered", "Microservice"]
}
````
@ -20,15 +20,23 @@ Please follow the steps below to prepare your development environment for React
1. **Install Node.js:** Please visit [Node.js downloads page](https://nodejs.org/en/download/) and download proper Node.js v20.11+ installer for your OS. An alternative is to install [NVM](https://github.com/nvm-sh/nvm) and use it to have multiple versions of Node.js in your operating system.
2. **[Optional] Install Yarn:** You may install Yarn v1 (not v2) following the instructions on [the installation page](https://classic.yarnpkg.com/en/docs/install). Yarn v1 delivers an arguably better developer experience compared to npm v6 and below. You may skip this step and work with npm, which is built-in in Node.js, instead.
3. **[Optional] Install VS Code:** [VS Code](https://code.visualstudio.com/) is a free, open-source IDE which works seamlessly with TypeScript. Although you can use any IDE including Visual Studio or Rider, VS Code will most likely deliver the best developer experience when it comes to React Native projects.
4. **Install an Emulator:** React Native applications need an Android emulator or an iOS simulator to run on your OS. See the [Android Studio Emulator](https://docs.expo.io/workflow/android-simulator/) or [iOS Simulator](https://docs.expo.io/workflow/ios-simulator/) on expo.io documentation to learn how to set up an emulator.
4. **Install an Emulator/Simulator:** React Native applications need an Android emulator or an iOS simulator to run on your OS. If you do not have Android Studio installed and configured on your system, we recommend [setting up android emulator without android studio](setting-up-android-emulator.md).
If you prefer the other way, you can check the [Android Studio Emulator](https://docs.expo.dev/workflow/android-studio-emulator/) or [iOS Simulator](https://docs.expo.dev/workflow/ios-simulator/) on expo.io documentation to learn how to set up an emulator.
## How to Start a New React Native Project
You have multiple options to initiate a new React Native project that works with ABP:
### 1. Using ABP CLI
### 1. Using ABP Studio
ABP Studio application is the most convenient and flexible way to initiate a React Native application based on ABP framework. You can follow the [tool documentation](../../../studio) and select the option below:
![React Native option](../../../images/react-native-option.png)
### 2. Using ABP CLI
ABP CLI is probably the most convenient and flexible way to initiate an ABP solution with a React Native application. Simply [install the ABP CLI](../../../cli) and run the following command in your terminal:
ABP CLI is another way of creating an ABP solution with a React Native application. Simply [install the ABP CLI](../../../cli) and run the following command in your terminal:
```shell
abp new MyCompanyName.MyProjectName -csf -u <angular or mvc> -m react-native
@ -38,33 +46,209 @@ abp new MyCompanyName.MyProjectName -csf -u <angular or mvc> -m react-native
This command will prepare a solution with an **Angular** or an **MVC** (depends on your choice), a **.NET Core**, and a **React Native** project in it.
### 2. Generating a CLI Command from Get Started Page
You can generate a CLI command on the [get started page of the abp.io website](https://abp.io/get-started). Then, use the command on your terminal to create a new [Startup Template](../../../solution-templates).
## How to Configure & Run the Backend
> React Native application does not trust the auto-generated .NET HTTPS certificate. You should use **HTTP** during the development.
> When you are using OpenIddict, You should remove 'clientSecret' on Environment.js (if exists) and disable "HTTPS-only" settings. (Openiddict has default since Version 6.0)
A React Native application running on an Android emulator or a physical phone **can not connect to the backend** on `localhost`. To fix this problem, it is necessary to run the backend application on your **local IP address**.
{{ if Tiered == "No"}}
![React Native host project local IP entry](../../../images/rn-host-local-ip.png)
- Open the `appsettings.json` file in the `.HttpApi.Host` folder. Replace the `localhost` address on the `SelfUrl` and `Authority` properties with your local IP address.
- Open the `launchSettings.json` file in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address.
{{ else if Tiered == "Yes" }}
![React Native tiered project local IP entry](../../../images/rn-tiered-local-ip.png)
- Open the `appsettings.json` file in the `.AuthServer` folder. Replace the `localhost` address on the `SelfUrl` property with your local IP address.
- Open the `launchSettings.json` file in the `.AuthServer/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address.
- Open the `appsettings.json` file in the `.HttpApi.Host` folder. Replace the `localhost` address on the `Authority` property with your local IP address.
- Open the `launchSettings.json` file in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address.
A React Native application running on an Android emulator or a physical phone **can not connect to the backend** on `localhost`. To fix this problem, it is necessary to run the backend application using the `Kestrel` configuration.
{{ if Architecture == "Monolith" }}
![React Native monolith host project configuration](../../../images/react-native-monolith-be-config.png)
- Open the `appsettings.json` file in the `.DbMigrator` folder. Replace the `localhost` address on the `RootUrl` property with your local IP address. Then, run the database migrator.
- Open the `appsettings.Development.json` file in the `.HttpApi.Host` folder. Add this configuration to accept global requests just to test the react native application on the development environment.
```json
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:44323" //replace with your host port
}
}
}
}
```
{{ else if Architecture == "Tiered" }}
![React Native tiered project configuration](../../../images/react-native-tiered-be-config.png)
- Open the `appsettings.json` file in the `.DbMigrator` folder. Replace the `localhost` address on the `RootUrl` property with your local IP address. Then, run the database migrator.
- Open the `appsettings.Development.json` file in the `.AuthServer` folder. Add this configuration to accept global requests just to test the react native application on the development environment.
```json
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:44337"
}
}
}
}
```
- Open the `appsettings.Development.json` file in the `.HttpApi.Host` folder. Add this configuration to accept global requests again. In addition, you will need to introduce the authentication server as mentioned above.
```json
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:44389" //replace with your host port
}
}
},
"AuthServer": {
"Authority": "http://192.168.1.37:44337/", //replace with your IP and authentication port
"MetaAddress": "http://192.168.1.37:44337/",
"RequireHttpsMetadata": false,
"Audience": "MyTieredProject" //replace with your application name
}
}
```
{{ else if Architecture == "Microservice" }}
![React Native microservice project configuration](../../../images/react-native-microservice-be-config.png)
- Open the `appsettings.Development.json` file in the `.AuthServer` folder. Add this configuration to accept global requests just to test the react native application on the development environment.
```json
{
"App": {
"EnablePII": true
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:44319"
}
}
}
}
```
- Open the `appsettings.Development.json` file in the `.AdministrationService` folder. Add this configuration to accept global requests just to test the react native application on the development environment. You should also provide the authentication server configuration. In addition, you need to apply the same process for all the services you would use in the react native application.
```json
{
"App": {
"EnablePII": true
},
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://0.0.0.0:44357"
}
}
},
"AuthServer": {
"Authority": "http://192.168.1.36:44319/",
"MetaAddress": "http://192.168.1.36:44319/",
"RequireHttpsMetadata": false,
"Audience": "AdministrationService"
}
}
```
- Update the `appsettings.json` file in the `.IdentityService` folder. Replace the `localhost` configuration with your local IP address for the react native application
```json
{
//...
"OpenIddict": {
"Applications": {
//...
"ReactNative": {
"RootUrl": "exp://192.168.1.36:19000"
},
"MobileGateway": {
"RootUrl": "http://192.168.1.36:44347/"
},
//...
},
//...
}
}
```
- Lastly, update the mobile gateway configurations as following:
```json
//gateways/mobile/MyMicroserviceProject.MobileGateway/Properties/launchSettings.json
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://192.168.1.36:44347" //update with your IP address
}
},
"profiles": {
//...
"MyMicroserviceProject.MobileGateway": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "http://192.168.1.36:44347",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
```
```json
//gateways/mobile/MyMicroserviceProject.MobileGateway/appsettings.json
{
//Update clusters with your IP address
//...
"ReverseProxy": {
//...
"Clusters": {
"AuthServer": {
"Destinations": {
"AuthServer": {
"Address": "http://192.168.1.36:44319/"
}
}
},
"Administration": {
"Destinations": {
"Administration": {
"Address": "http://192.168.1.36:44357/"
}
}
},
"Saas": {
"Destinations": {
"Saas": {
"Address": "http://192.168.1.36:44330/"
}
}
},
"Identity": {
"Destinations": {
"Identity": {
"Address": "http://192.168.1.36:44397/"
}
}
},
"Language": {
"Destinations": {
"Identity": {
"Address": "http://192.168.1.36:44310/"
}
}
}
}
}
}
```
{{ end }}
Run the backend application as described in the [getting started document](../../../get-started).
@ -73,7 +257,7 @@ Run the backend application as described in the [getting started document](../..
## How to disable the Https-only settings of OpenIddict
Open the {{ if Tiered == "No" }}`MyProjectNameHttpApiHostModule`{{ else if Tiered == "Yes" }}`MyProjectNameAuthServerModule`{{ end }} project and copy-paste the below code-block to the `PreConfigureServices` method:
Open the {{ if Architecture == "Monolith" }}`MyProjectNameHttpApiHostModule`{{ if Architecture == "Tiered" }}`MyProjectNameAuthServerModule`{{ end }} project and copy-paste the below code-block to the `PreConfigureServices` method:
```csharp
#if DEBUG
@ -89,21 +273,27 @@ Open the {{ if Tiered == "No" }}`MyProjectNameHttpApiHostModule`{{ else if Tiere
1. Make sure the [database migration is complete](../../../get-started?UI=NG&DB=EF&Tiered=No#create-the-database) and the [API is up and running](../../../get-started?UI=NG&DB=EF&Tiered=No#run-the-application).
2. Open `react-native` folder and run `yarn` or `npm install` if you have not already.
3. Open the `Environment.js` in the `react-native` folder and replace the `localhost` address on the `apiUrl` and `issuer` properties with your local IP address as shown below:
3. Open the `Environment.ts` in the `react-native` folder and replace the `localhost` address on the `apiUrl` and `issuer` properties with your local IP address as shown below:
{{ if Architecture == "Monolith" }}
![react native environment local IP](../../../images/rn-environment-local-ip.png)
![react native monolith environment local IP](../../../images/react-native-monolith-environment-local-ip.png)
{{ if Tiered == "Yes" }}
{{ else if Architecture == "Tiered" }}
![react native tiered environment local IP](../../../images/react-native-tiered-environment-local-ip.png)
> Make sure that `issuer` matches the running address of the `.AuthServer` project, `apiUrl` matches the running address of the `.HttpApi.Host` or `.Web` project.
{{else}}
{{ else }}
![react native microservice environment local IP](../../../images/react-native-microservice-environment-local-ip.png)
> Make sure that `issuer` and `apiUrl` matches the running address of the `.HttpApi.Host` or `.Web` project.
> Make sure that `issuer` matches the running address of the `.AuthServer` project, `apiUrl` matches the running address of the `.AuthServer` project.
{{ end }}
4. Run `yarn start` or `npm start`. Wait for the Expo CLI to print the opitons.
1. Run `yarn start` or `npm start`. Wait for the Expo CLI to print the opitons.
> The React Native application was generated with [Expo](https://expo.io/). Expo is a set of tools built around React Native to help you quickly start an app and, while it has many features.
@ -113,14 +303,14 @@ In the above image, you can start the application with an Android emulator, an i
### Expo
![React Native login screen on iPhone 11](../../../images/rn-login-iphone.png)
![React Native login screen on iPhone 16](../../../images/rn-login-iphone.png)
### Android Studio
1. Start the emulator in **Android Studio** before running the `yarn start` or `npm start` command.
2. Press **a** to open in Android Studio.
![React Native login screen on iPhone 11](../../../images/rn-login-android-studio.png)
![React Native login screen on Android Device](../../../images/rn-login-android-studio.png)
Enter **admin** as the username and **1q2w3E\*** as the password to login to the application.

127
docs/en/framework/ui/react-native/setting-up-android-emulator.md

@ -0,0 +1,127 @@
# Setting Up Android Emulator Without Android Studio (Windows, macOS, Linux)
This guide explains how to install and run an Android emulator **without Android Studio**, using only **Command Line Tools**.
---
## 1. Download Required Tools
Go to: [https://developer.android.com/studio#command-tools](https://developer.android.com/studio#command-tools)
Download the "Command line tools only" package for your OS:
- **Windows:** `commandlinetools-win-*.zip`
- **macOS:** `commandlinetools-mac-*.zip`
- **Linux:** `commandlinetools-linux-*.zip`
---
## 2. Create the Required Directory Structure
### Windows:
```
C:\Android\
└── cmdline-tools\
└── latest\
└── [extract all files from the zip here]
```
### macOS / Linux:
```
~/Android/
└── cmdline-tools/
└── latest/
└── [extract all files from the zip here]
```
> You need to create the `latest` folder manually.
---
## 3. Set Environment Variables
### Windows (temporary for CMD session):
```cmd
set PATH=C:\Android\cmdline-tools\latest\bin;C:\Android\platform-tools;C:\Android\emulator;%PATH%
```
### macOS / Linux:
Add the following to your `.bashrc`, `.zshrc`, or `.bash_profile` file:
```bash
export ANDROID_HOME=$HOME/Android
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
```
> Apply the changes:
```bash
source ~/.zshrc # or ~/.bashrc if you're using bash
```
---
## 4. Install SDK Components
Install platform tools, emulator, and a system image:
```bash
sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-34" "system-images;android-34;google_apis;x86_64" "emulator"
```
> On Windows, replace `$ANDROID_HOME` with `--sdk_root=C:\Android`.
---
## 5. Create an AVD (Android Virtual Device)
### List available devices:
```bash
avdmanager list devices
```
### Create your AVD:
```bash
avdmanager create avd -n myEmu -k "system-images;android-34;google_apis;x86_64" --device "pixel"
```
---
## 6. Start the Emulator
```bash
emulator -avd myEmu
```
The emulator window should open
---
## Extra Tools and Commands
### List connected devices with ADB:
```bash
adb devices
```
### Install an APK:
```bash
adb install myApp.apk
```
---
## Troubleshooting
| Problem | Explanation |
|--------|-------------|
| `sdkmanager not found` | Make sure `PATH` includes the `latest/bin` directory |
| `x86_64 system image not found` | Make sure you've downloaded it using `sdkmanager` |
| `emulator not found` | Add the `emulator` directory to `PATH` |
| `setx` truncates path (Windows) | Use GUI to update environment variables manually |
---
## Summary
You can now run an Android emulator without installing Android Studio, entirely through the command line. This emulator can be used for React Native or any mobile development framework.

BIN
docs/en/get-started/images/abp-studio-mobile-sample.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 5.4 MiB

5
docs/en/get-started/layered-web-application.md

@ -242,6 +242,8 @@ You can use `admin` as username and `1q2w3E*` as default password to login to th
> Note: If you haven't selected a mobile framework, you can skip this step.
Before starting the mobile application, ensure that you have configured it for [react-native](../framework/ui/react-native) or [MAUI](../framework/ui/maui).
You can start the following application(s):
{{ if Tiered == "Yes" }}
@ -255,8 +257,7 @@ You can start the following application(s):
{{ else }}
- `Acme.BookStore.Web`
{{ end }}
Before starting the mobile application, ensure that you configure it for [react-native](../framework/ui/react-native) or [MAUI](../framework/ui/maui).
- `react-native` or `Acme.Bookstore.Maui`
![mobile-sample](images/abp-studio-mobile-sample.gif)

BIN
docs/en/images/author-input-in-book-form.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 68 KiB

BIN
docs/en/images/author-list-with-options.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
docs/en/images/author-list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 76 KiB

BIN
docs/en/images/authors-in-book-form.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 72 KiB

BIN
docs/en/images/book-list-with-author.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 77 KiB

BIN
docs/en/images/book-list-with-options.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 79 KiB

BIN
docs/en/images/book-list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 74 KiB

BIN
docs/en/images/book-store-menu-item.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 78 KiB

BIN
docs/en/images/books-menu-item.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
docs/en/images/create-author.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 63 KiB

BIN
docs/en/images/create-book-button-visibility.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
docs/en/images/create-book-icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
docs/en/images/create-book.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 70 KiB

BIN
docs/en/images/delete-author-alert.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 87 KiB

BIN
docs/en/images/delete-book-alert.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 76 KiB

BIN
docs/en/images/delete-book.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
docs/en/images/react-native-environment-local-ip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
docs/en/images/react-native-introduction.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 KiB

After

Width:  |  Height:  |  Size: 4.9 MiB

BIN
docs/en/images/react-native-microservice-be-config.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

BIN
docs/en/images/react-native-monolith-be-config.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

BIN
docs/en/images/react-native-monolith-environment-local-ip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

BIN
docs/en/images/react-native-option.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
docs/en/images/react-native-store-folder.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
docs/en/images/react-native-tiered-be-config.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

BIN
docs/en/images/react-native-tiered-environment-local-ip.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
docs/en/images/rn-login-android-studio.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 54 KiB

BIN
docs/en/images/rn-login-iphone.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 682 KiB

BIN
docs/en/images/update-author.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 664 KiB

BIN
docs/en/images/update-book.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 669 KiB

BIN
docs/en/images/update-delete-book-button-visibility.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 98 KiB

10
docs/en/solution-templates/layered-web-application/mobile-applications.md

@ -94,22 +94,22 @@ You can follow [Mobile Application Development Tutorial - MAUI](../../tutorials/
This is the mobile application that is built based on Facebook's [React Native framework](https://reactnative.dev/) and [Expo](https://expo.dev/). It will be in the solution only if you've selected React Native as your mobile application option.
#### Project Structure
- **Environment.js**: file using for provide application level variables like `apiUrl`, `oAuthConfig` and etc.
- **Environment.ts**: file using for provide application level variables like `apiUrl`, `oAuthConfig` and etc.
- **api**: The `api` folder contains HTTP request files that simplify API management in the React Native starter template
- `API.js:` exports **axiosInstance**. It provides axios instance filled api url
- `API.ts:` exports **axiosInstance**. It provides axios instance filled api url
- **components**: In the `components` folder you can reach built in react native components that you can use in your app. These components **facilitates** your list, select and etc. operations
- **contexts**: `contexts` folder contains [react context](https://react.dev/reference/react/createContext). You can expots your contexts in this folder. `Localization context provided in here`
- **navigators**: folder contains [react-native stacks](https://reactnavigation.org/docs/stack-navigator/). After create new *FeatureName*Navigator we need to provide in `DrawerNavigator.js` file as `Drawer.Screen`
- **navigators**: folder contains [react-native stacks](https://reactnavigation.org/docs/stack-navigator/). After create new *FeatureName*Navigator we need to provide in `DrawerNavigator.tsx` file as `Drawer.Screen`
- **screens**: is the content of navigated page. We'll pass as component property to [Stack.Screen](https://reactnavigation.org/docs/native-stack-navigator/)
- **store**: folder manages state-management operations. We will define `actions`, `reducers`, `sagas` and `selectors` here.
- **store**: folder manages state-management operations. We will define `actions`, `listeners`, `reducers`, and `selectors` here.
- **styles**: folder contains app styles. `system-style.js` comes built in template we can also add new styles.
- **styles**: folder contains app styles. `system-style.ts` comes built in template we can also add new styles.
- **utils**: folder contains helper functions that we can use in application

22
docs/en/solution-templates/microservice/mobile-applications.md

@ -139,22 +139,28 @@ You can follow [Mobile Application Development Tutorial - MAUI](../../tutorials/
This is the mobile application that is built based on Facebook's [React Native framework](https://reactnative.dev/) and [Expo](https://expo.dev/). It will be in the solution only if you've selected React Native as your mobile application option.
#### Project Structure
- **Environment.js**: file using for provide application level variables like `apiUrl`, `oAuthConfig` and etc.
- **Environment.ts**: file using for providing application level variables like `apiUrl`, `oAuthConfig` and etc.
- **api**: The `api` folder contains HTTP request files that simplify API management in the React Native starter template
- `API.js:` exports **axiosInstance**. It provides axios instance filled api url
- `API.ts:` exports **axiosInstance**. It provides axios instance filled api url.
- **components**: In the `components` folder you can reach built in react native components that you can use in your app. These components **facilitates** your list, select and etc. operations
- **components**: In the `components` folder, you can reach built in react native components that you can use in your app. These components **facilitates** your list, select and etc. operations.
- **contexts**: `contexts` folder contains [react context](https://react.dev/reference/react/createContext). You can expots your contexts in this folder. `Localization context provided in here`
- **navigators**: folder contains [react-native stacks](https://reactnavigation.org/docs/stack-navigator/). After create new *FeatureName*Navigator we need to provide in `DrawerNavigator.js` file as `Drawer.Screen`
- **hocs**: this folder is added to contain higher order components. The purpose is to wrap components with additional features or properties. It initially has a `PermissionHoc.tsx` that wraps a component to check the permission grant status.
- **screens**: is the content of navigated page. We'll pass as component property to [Stack.Screen](https://reactnavigation.org/docs/native-stack-navigator/)
- **hooks**: covers the react native hooks where you can get a reference from [the official documentation](https://react.dev/reference/react/hooks).
- **store**: folder manages state-management operations. We will define `actions`, `reducers`, `sagas` and `selectors` here.
- **interceptors**: initializes a file called `APIInterceptor.ts` that has a function to manage the http operations in a better way.
- **styles**: folder contains app styles. `system-style.js` comes built in template we can also add new styles.
- **navigators**: folder contains [react-native stacks](https://reactnavigation.org/docs/stack-navigator/). After creating a new *FeatureName*Navigator we need to provide in `DrawerNavigator.ts` file as `Drawer.Screen`
- **screens**: folder has the content of navigated page. We will pass as component property to [Stack.Screen](https://reactnavigation.org/docs/native-stack-navigator/)
- **store**: folder manages state-management operations. We will define `actions`, `listeners`, `reducers`, and `selectors` here.
- **styles**: folder contains app styles. `system-style.ts` comes built in template we can also add new styles.
- **utils**: folder contains helper functions that we can use in application
@ -162,6 +168,6 @@ This is the mobile application that is built based on Facebook's [React Native f
React Native applications can't be run with the solution runner. You need to run them with the React Native CLI. You can check the [React Native documentation](https://reactnative.dev/docs/environment-setup) to learn how to setup the environment for React Native development.
Before running the React Native application, rest of the applications in the solution must be running. Such as AuthServer, MobileGateway and the microservices.
Before running the React Native application, the rest of the applications in the solution must be running. Such as AuthServer, MobileGateway and the microservices.
Then you can run the React Native application by following this documentation: [Getting Started with the React Native](../../framework/ui/react-native/index.md).

8
docs/en/suite/solution-structure.md

@ -318,8 +318,8 @@ React Native application folder structure is like below:
![react-native-folder-structure](../images/react-native-folder-structure.png)
* `App.js` is the bootstrap component of the application.
* `Environment.js` file has the essential configuration of the application. `prod` and `dev` configurations are defined in this file.
* `App.tsx` is the bootstrap component of the application.
* `Environment.ts` file has the essential configuration of the application. `prod` and `dev` configurations are defined in this file.
* [Contexts](https://reactjs.org/docs/context.html) are created in the `src/contexts` folder.
* [Higher order components](https://reactjs.org/docs/higher-order-components.html) are created in the `src/hocs` folder.
* [Custom hooks](https://reactjs.org/docs/hooks-custom.html#extracting-a-custom-hook) are created in the `src/hooks`.
@ -353,12 +353,11 @@ Actions, reducers, sagas, selectors are created in the `src/store` folder. Store
* [**Store**](https://redux.js.org/basics/store) is defined in the `src/store/index.js` file.
* [**Actions**](https://redux.js.org/basics/actions/) are payloads of information that send data from your application to your store.
* [**Reducers**](https://redux.js.org/basics/reducers) specify how the application's state changes in response to actions sent to the store.
* [**Redux-Saga**](https://redux-saga.js.org/) is a library that aims to make application side effects (i.e. asynchronous things like data fetching and impure things like accessing the browser cache) easier to manage. Sagas are created in the `src/store/sagas` folder.
* [**Reselect**](https://github.com/reduxjs/reselect) library is used to create memoized selectors. Selectors are created in the `src/store/selectors` folder.
### APIs
[Axios](https://github.com/axios/axios) is used as the HTTP client library. An Axios instance is exported from `src/api/API.js` file to make HTTP calls with the same config. `src/api` folder also has the API files that have been created for API calls.
[Axios](https://github.com/axios/axios) is used as the HTTP client library. An Axios instance is exported from `src/api/API.ts` file to make HTTP calls with the same config. `src/api` folder also has the API files that have been created for API calls.
### Theming
@ -381,7 +380,6 @@ See the [Testing Overview](https://reactjs.org/docs/testing.html) document.
* [Axios](https://github.com/axios/axios) is used as HTTP client library.
* [Redux](https://redux.js.org/) is used as state management library.
* [Redux Toolkit](https://redux-toolkit.js.org/) library is used as a toolset for efficient Redux development.
* [Redux-Saga](https://redux-saga.js.org/) is used to manage asynchronous processes.
* [Redux Persist](https://github.com/rt2zz/redux-persist) is used for state persistance.
* [Reselect](https://github.com/reduxjs/reselect) is used to create memoized selectors.
* [i18n-js](https://github.com/fnando/i18n-js) is used as i18n library.

963
docs/en/tutorials/mobile/react-native/index.md

File diff suppressed because it is too large

1
framework/Volo.Abp.sln.DotSettings

@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AI/@EntryIndexedValue">AI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=E193A13E6CDABC4687BFBCAD92DEDC16/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=E193A13E6CDABC4687BFBCAD92DEDC16/AbsolutePath/@EntryValue">D:\Github\abp\common.DotSettings</s:String>

8
framework/Volo.Abp.slnx

@ -62,6 +62,7 @@
<Project Path="src/Volo.Abp.BlobStoring.Bunny/Volo.Abp.BlobStoring.Bunny.csproj" />
<Project Path="src/Volo.Abp.BlobStoring.FileSystem/Volo.Abp.BlobStoring.FileSystem.csproj" />
<Project Path="src/Volo.Abp.BlobStoring.Google/Volo.Abp.BlobStoring.Google.csproj" />
<Project Path="src/Volo.Abp.BlobStoring.Memory/Volo.Abp.BlobStoring.Memory.csproj" />
<Project Path="src/Volo.Abp.BlobStoring.Minio/Volo.Abp.BlobStoring.Minio.csproj" />
<Project Path="src/Volo.Abp.BlobStoring/Volo.Abp.BlobStoring.csproj" />
<Project Path="src/Volo.Abp.Caching.StackExchangeRedis/Volo.Abp.Caching.StackExchangeRedis.csproj" />
@ -163,7 +164,8 @@
<Project Path="src/Volo.Abp.Validation/Volo.Abp.Validation.csproj" />
<Project Path="src/Volo.Abp.VirtualFileSystem/Volo.Abp.VirtualFileSystem.csproj" />
<Project Path="src/Volo.Abp/Volo.Abp.csproj" />
<Project Path="src/Volo.Abp.BlobStoring.Memory/Volo.Abp.BlobStoring.Memory.csproj" />
<Project Path="src/Volo.Abp.AI.Abstractions/Volo.Abp.AI.Abstractions.csproj" />
<Project Path="src/Volo.Abp.AI/Volo.Abp.AI.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/AbpTestBase/AbpTestBase.csproj" />
@ -189,6 +191,7 @@
<Project Path="test/Volo.Abp.BlobStoring.Bunny.Tests/Volo.Abp.BlobStoring.Bunny.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.FileSystem.Tests/Volo.Abp.BlobStoring.FileSystem.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.Google.Tests/Volo.Abp.BlobStoring.Google.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.Memory.Tests/Volo.Abp.BlobStoring.Memory.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.Minio.Tests/Volo.Abp.BlobStoring.Minio.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.Tests/Volo.Abp.BlobStoring.Tests.csproj" />
<Project Path="test/Volo.Abp.Caching.StackExchangeRedis.Tests/Volo.Abp.Caching.StackExchangeRedis.Tests.csproj" />
@ -248,6 +251,5 @@
<Project Path="test/Volo.Abp.Uow.Tests/Volo.Abp.Uow.Tests.csproj" />
<Project Path="test/Volo.Abp.Validation.Tests/Volo.Abp.Validation.Tests.csproj" />
<Project Path="test/Volo.Abp.VirtualFileSystem.Tests/Volo.Abp.VirtualFileSystem.Tests.csproj" />
<Project Path="test/Volo.Abp.BlobStoring.Memory.Tests/Volo.Abp.BlobStoring.Memory.Tests.csproj" />
</Folder>
</Solution>
</Solution>

3
framework/src/Volo.Abp.AI.Abstractions/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
framework/src/Volo.Abp.AI.Abstractions/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

3
framework/src/Volo.Abp.AI.Abstractions/Volo.Abp.AI.Abstractions.abppkg

@ -0,0 +1,3 @@
{
"role": "lib.framework"
}

26
framework/src/Volo.Abp.AI.Abstractions/Volo.Abp.AI.Abstractions.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<PackageId>Volo.Abp.AI.Abstractions</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" />
</ItemGroup>
</Project>

10
framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/AbpAIAbstractionsModule.cs

@ -0,0 +1,10 @@
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;
namespace Volo.Abp.AI;
public class AbpAIAbstractionsModule : AbpModule
{
}

8
framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/IChatClient.cs

@ -0,0 +1,8 @@
using Microsoft.Extensions.AI;
namespace Volo.Abp.AI;
public interface IChatClient<TWorkSpace> : IChatClient
where TWorkSpace : class
{
}

14
framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/IKernelAccessor.cs

@ -0,0 +1,14 @@
using Microsoft.SemanticKernel;
namespace Volo.Abp.AI;
public interface IKernelAccessor
{
Kernel? Kernel { get; }
}
public interface IKernelAccessor<TWorkSpace> : IKernelAccessor
where TWorkSpace : class
{
}

38
framework/src/Volo.Abp.AI.Abstractions/Volo/Abp/AI/WorkspaceNameAttribute.cs

@ -0,0 +1,38 @@
using System;
using System.Linq;
using System.Collections.Concurrent;
namespace Volo.Abp.AI;
[AttributeUsage(AttributeTargets.Class)]
public class WorkspaceNameAttribute : Attribute
{
public string Name { get; }
public WorkspaceNameAttribute(string name)
{
Check.NotNull(name, nameof(name));
Name = name;
}
private static readonly ConcurrentDictionary<Type, string> _nameCache = new();
public static string GetWorkspaceName<TWorkspace>()
{
return GetWorkspaceName(typeof(TWorkspace));
}
public static string GetWorkspaceName(Type workspaceType)
{
return _nameCache.GetOrAdd(workspaceType, type =>
{
var workspaceNameAttribute = type
.GetCustomAttributes(true)
.OfType<WorkspaceNameAttribute>()
.FirstOrDefault();
return workspaceNameAttribute?.Name ?? type.FullName!;
});
}
}

3
framework/src/Volo.Abp.AI/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
framework/src/Volo.Abp.AI/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

3
framework/src/Volo.Abp.AI/Volo.Abp.AI.abppkg

@ -0,0 +1,3 @@
{
"role": "lib.framework"
}

27
framework/src/Volo.Abp.AI/Volo.Abp.AI.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<PackageId>Volo.Abp.AI</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AI.Abstractions\Volo.Abp.AI.Abstractions.csproj" />
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel" />
</ItemGroup>
</Project>

96
framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIModule.cs

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Volo.Abp.Modularity;
namespace Volo.Abp.AI;
[DependsOn(
typeof(AbpAIAbstractionsModule)
)]
public class AbpAIModule : AbpModule
{
public const string DefaultWorkspaceName = "Default";
public override void PostConfigureServices(ServiceConfigurationContext context)
{
var options = context.Services.ExecutePreConfiguredActions<AbpAIOptions>();
context.Services.Configure<AbpAIWorkspaceOptions>(workspaceOptions =>
{
workspaceOptions.ConfiguredWorkspaceNames.UnionWith(options.Workspaces.Select(x => x.Key).ToArray());
});
foreach (var workspaceConfig in options.Workspaces.Values)
{
if (workspaceConfig.ChatClient?.Builder is null)
{
continue;
}
foreach (var builderConfigurer in workspaceConfig.ChatClient.BuilderConfigurers)
{
builderConfigurer.Action(workspaceConfig.ChatClient.Builder!);
}
context.Services.AddKeyedChatClient(
AbpAIOptions.GetChatClientServiceKeyName(workspaceConfig.Name),
provider => workspaceConfig.ChatClient.Builder!.Build(provider),
ServiceLifetime.Transient
);
if (workspaceConfig.Name == DefaultWorkspaceName)
{
context.Services.AddTransient<IChatClient>(sp => sp.GetRequiredKeyedService<IChatClient>(
AbpAIOptions.GetChatClientServiceKeyName(workspaceConfig.Name)
)
);
}
}
context.Services.TryAddTransient(typeof(IChatClient<>), typeof(TypedChatClient<>));
foreach (var workspaceConfig in options.Workspaces.Values)
{
if (workspaceConfig.Kernel?.Builder is null)
{
continue;
}
foreach (var builderConfigurer in workspaceConfig.Kernel.BuilderConfigurers)
{
builderConfigurer.Action(workspaceConfig.Kernel.Builder!);
}
// TODO: Check if we can use transient instead of singleton for Kernel
context.Services.AddKeyedTransient<Kernel>(
AbpAIOptions.GetKernelServiceKeyName(workspaceConfig.Name),
(provider, _) => workspaceConfig.Kernel.Builder!.Build());
if (workspaceConfig.Name == DefaultWorkspaceName)
{
context.Services.AddTransient<Kernel>(sp => sp.GetRequiredKeyedService<Kernel>(
AbpAIOptions.GetKernelServiceKeyName(workspaceConfig.Name)
)
);
}
if (workspaceConfig.ChatClient?.Builder is null)
{
context.Services.AddKeyedTransient<IChatClient>(
AbpAIOptions.GetChatClientServiceKeyName(workspaceConfig.Name),
(sp, _) => sp.GetKeyedService<Kernel>(AbpAIOptions.GetKernelServiceKeyName(workspaceConfig.Name))?
.GetRequiredService<IChatClient>()
?? throw new InvalidOperationException("Kernel or IChatClient not found with workspace name: " + workspaceConfig.Name)
);
}
}
context.Services.TryAddTransient(typeof(IKernelAccessor<>), typeof(TypedKernelAccessor<>));
}
}

19
framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIOptions.cs

@ -0,0 +1,19 @@
namespace Volo.Abp.AI;
public class AbpAIOptions
{
public const string ChatClientServiceKeyNamePrefix = "Abp.AI.ChatClient_";
public const string KernelServiceKeyNamePrefix = "Abp.AI.Kernel_";
public WorkspaceConfigurationDictionary Workspaces { get; } = new();
public static string GetChatClientServiceKeyName(string name)
{
return $"{ChatClientServiceKeyNamePrefix}{name}";
}
public static string GetKernelServiceKeyName(string name)
{
return $"{KernelServiceKeyNamePrefix}{name}";
}
}

8
framework/src/Volo.Abp.AI/Volo/Abp/AI/AbpAIWorkspaceOptions.cs

@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace Volo.Abp.AI;
public class AbpAIWorkspaceOptions
{
public HashSet<string> ConfiguredWorkspaceNames { get; } = new();
}

8
framework/src/Volo.Abp.AI/Volo/Abp/AI/BuilderConfigurerList.cs

@ -0,0 +1,8 @@
using Microsoft.Extensions.AI;
namespace Volo.Abp.AI;
public class BuilderConfigurerList : NamedActionList<ChatClientBuilder>
{
}

23
framework/src/Volo.Abp.AI/Volo/Abp/AI/ChatClientConfiguration.cs

@ -0,0 +1,23 @@
using System;
using Microsoft.Extensions.AI;
namespace Volo.Abp.AI;
public class ChatClientConfiguration
{
public ChatClientBuilder? Builder { get; set; }
public BuilderConfigurerList BuilderConfigurers { get; } = new();
// TODO: Base chat client (for inheriting a chat client configuration from some other one)
public void ConfigureBuilder(Action<ChatClientBuilder> configureAction)
{
BuilderConfigurers.Add(configureAction);
}
public void ConfigureBuilder(string name, Action<ChatClientBuilder> configureAction)
{
BuilderConfigurers.Add(name, configureAction);
}
}

18
framework/src/Volo.Abp.AI/Volo/Abp/AI/DefaultKernelAccessor.cs

@ -0,0 +1,18 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AI;
[ExposeServices(typeof(IKernelAccessor))]
public class DefaultKernelAccessor : IKernelAccessor, ITransientDependency
{
public Kernel? Kernel { get; }
public DefaultKernelAccessor(IServiceProvider serviceProvider)
{
Kernel = serviceProvider.GetKeyedService<Kernel>(
AbpAIModule.DefaultWorkspaceName);
}
}

9
framework/src/Volo.Abp.AI/Volo/Abp/AI/KernelBuilderConfigurerList.cs

@ -0,0 +1,9 @@
using Microsoft.SemanticKernel;
namespace Volo.Abp.AI;
public class KernelBuilderConfigurerList : NamedActionList<IKernelBuilder>
{
}

21
framework/src/Volo.Abp.AI/Volo/Abp/AI/KernelConfiguration.cs

@ -0,0 +1,21 @@
using System;
using Microsoft.SemanticKernel;
namespace Volo.Abp.AI;
public class KernelConfiguration
{
public IKernelBuilder? Builder { get; set; }
public KernelBuilderConfigurerList BuilderConfigurers { get; } = new();
public void ConfigureBuilder(Action<IKernelBuilder> configureAction)
{
BuilderConfigurers.Add(configureAction);
}
public void ConfigureBuilder(string name, Action<IKernelBuilder> configureAction)
{
BuilderConfigurers.Add(name, configureAction);
}
}

18
framework/src/Volo.Abp.AI/Volo/Abp/AI/TypedChatClient.cs

@ -0,0 +1,18 @@
using System;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.DependencyInjection;
namespace Volo.Abp.AI;
public class TypedChatClient<TWorkSpace> : DelegatingChatClient, IChatClient<TWorkSpace>
where TWorkSpace : class
{
public TypedChatClient(IServiceProvider serviceProvider)
: base(
serviceProvider.GetRequiredKeyedService<IChatClient>(
AbpAIOptions.GetChatClientServiceKeyName(
WorkspaceNameAttribute.GetWorkspaceName<TWorkSpace>()))
)
{
}
}

20
framework/src/Volo.Abp.AI/Volo/Abp/AI/TypedKernelAccessor.cs

@ -0,0 +1,20 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.SemanticKernel;
namespace Volo.Abp.AI;
public class TypedKernelAccessor<TWorkSpace> : IKernelAccessor<TWorkSpace>
where TWorkSpace : class
{
public Kernel? Kernel { get; }
public TypedKernelAccessor(IServiceProvider serviceProvider)
{
Kernel = serviceProvider.GetKeyedService<Kernel>(
AbpAIOptions.GetKernelServiceKeyName(
WorkspaceNameAttribute.GetWorkspaceName<TWorkSpace>()));
}
}

28
framework/src/Volo.Abp.AI/Volo/Abp/AI/WorkspaceConfiguration.cs

@ -0,0 +1,28 @@
using System;
namespace Volo.Abp.AI;
public class WorkspaceConfiguration
{
public string Name { get; }
public ChatClientConfiguration ChatClient { get; } = new();
public KernelConfiguration Kernel { get; } = new();
public WorkspaceConfiguration(string name)
{
Name = name;
}
public WorkspaceConfiguration ConfigureChatClient(Action<ChatClientConfiguration> configureAction)
{
configureAction(ChatClient);
return this;
}
public WorkspaceConfiguration ConfigureKernel(Action<KernelConfiguration> configureAction)
{
configureAction(Kernel);
return this;
}
}

29
framework/src/Volo.Abp.AI/Volo/Abp/AI/WorkspaceConfigurationDictionary.cs

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
namespace Volo.Abp.AI;
public class WorkspaceConfigurationDictionary : Dictionary<string, WorkspaceConfiguration>
{
public void Configure<TWorkSpace>(Action<WorkspaceConfiguration>? configureAction = null)
where TWorkSpace : class
{
Configure(WorkspaceNameAttribute.GetWorkspaceName<TWorkSpace>(), configureAction);
}
public void Configure(string name, Action<WorkspaceConfiguration>? configureAction = null)
{
if (!TryGetValue(name, out var configuration))
{
configuration = new WorkspaceConfiguration(name);
this[name] = configuration;
}
configureAction?.Invoke(configuration);
}
public void ConfigureDefault(Action<WorkspaceConfiguration>? configureAction = null)
{
Configure(AbpAIModule.DefaultWorkspaceName, configureAction);
}
}

10
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs

@ -30,9 +30,17 @@ public class AbpCachingModule : AbpModule
context.Services.AddSingleton(typeof(IHybridCache<>), typeof(AbpHybridCache<>));
context.Services.AddSingleton(typeof(IHybridCache<,>), typeof(AbpHybridCache<,>));
context.Services.Configure<AbpDistributedCacheOptions>(cacheOptions =>
Configure<AbpDistributedCacheOptions>(cacheOptions =>
{
cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20);
});
if (context.Services.GetAbpHostEnvironment().IsDevelopment())
{
Configure<AbpDistributedCacheOptions>(options =>
{
options.HideErrors = false;
});
}
}
}

6
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs

@ -21,9 +21,11 @@ public class LogoutCommand : IConsoleCommand, ITransientDependency
Logger = NullLogger<LogoutCommand>.Instance;
}
public Task ExecuteAsync(CommandLineArgs commandLineArgs)
public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
{
return AuthService.LogoutAsync();
await AuthService.LogoutAsync();
Logger.LogInformation("You are logged out.");
}
public string GetUsageInfo()

14
framework/src/Volo.Abp.Core/Volo/Abp/Collections/NamedActionList.cs

@ -0,0 +1,14 @@
using System;
namespace Volo.Abp.AI;
public class NamedActionList<T> : NamedObjectList<NamedAction<T>>
{
public void Add(Action<T> action)
{
this.Add(Guid.NewGuid().ToString("N"), action);
}
public void Add(string name, Action<T> action)
=> this.Add(new NamedAction<T>(name, action));
}

9
framework/src/Volo.Abp.Core/Volo/Abp/Collections/NamedObjectList.cs

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Volo.Abp.AI;
public class NamedObjectList<T> : List<T>
where T : NamedObject
{
}

14
framework/src/Volo.Abp.Core/Volo/Abp/NamedAction.cs

@ -0,0 +1,14 @@
using System;
namespace Volo.Abp;
public class NamedAction<T> : NamedObject
{
public Action<T> Action { get; set; }
public NamedAction(string name, Action<T> action)
: base(name)
{
Action = Check.NotNull(action, nameof(action));
}
}

11
framework/src/Volo.Abp.Core/Volo/Abp/NamedObject.cs

@ -0,0 +1,11 @@
namespace Volo.Abp;
public class NamedObject
{
public string Name { get; }
public NamedObject(string name)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name));
}
}

11
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/AspNetCore/ExceptionHandling/DefaultExceptionToErrorInfoConverter.cs

@ -195,13 +195,10 @@ public class DefaultExceptionToErrorInfoConverter : IExceptionToErrorInfoConvert
{
if (exception.EntityType != null)
{
return new RemoteServiceErrorInfo(
string.Format(
L["EntityNotFoundErrorMessage"],
exception.EntityType.Name,
exception.Id
)
);
var message = exception.Id != null
? string.Format(L["EntityNotFoundErrorMessage"], exception.EntityType.Name, exception.Id)
: string.Format(L["EntityNotFoundErrorMessageWithoutId"], exception.EntityType.Name);
return new RemoteServiceErrorInfo(message);
}
return new RemoteServiceErrorInfo(exception.Message);

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ar.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "المورد غير موجود!",
"DefaultErrorMessage404Detail": "لم يتم العثور على المورد المطلوب على الخادم!",
"EntityNotFoundErrorMessage": "لا يوجد كيان {0} بالمعرف = {1}!",
"EntityNotFoundErrorMessageWithoutId": "لا يوجد كيان {0}!",
"AbpDbConcurrencyErrorMessage": "تم تغيير البيانات التي قدمتها بالفعل من قبل مستخدم/عميل آخر. يرجى تجاهل التغييرات التي قمت بها والمحاولة من البداية.",
"Error": "خطأ",
"UnhandledException": "استثناء غير معالج!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/cs.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Prostředek nenalezen!",
"DefaultErrorMessage404Detail": "Vyžádaný prostředek nebyl na serveru nalezen!",
"EntityNotFoundErrorMessage": "Neexistující entita {0} s id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Neexistující entita {0}!",
"AbpDbConcurrencyErrorMessage": "Údaje, které jste odeslali, již změnil jiný uživatel/klient. Zahoďte provedené změny a zkuste to od začátku.",
"Error": "Chyba",
"UnhandledException": "Neošetřená výjimka!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/de.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Ressource nicht gefunden!",
"DefaultErrorMessage404Detail": "Die angeforderte Ressource konnte nicht auf dem Server gefunden werden!",
"EntityNotFoundErrorMessage": "Es gibt keine Entität {0} mit id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Es gibt keine Entität {0}!",
"AbpDbConcurrencyErrorMessage": "Die von Ihnen übermittelten Daten wurden bereits von einem anderen Benutzer/Kunden geändert. Bitte verwerfen Sie die vorgenommenen Änderungen und versuchen Sie es von vorne.",
"Error": "Fehler",
"UnhandledException": "Unbehandelte Ausnahme!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/el.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Ο πόρος δεν βρέθηκε!",
"DefaultErrorMessage404Detail": "Ο πόρος που ζητήθηκε δεν βρέθηκε στον διακομιστή!",
"EntityNotFoundErrorMessage": "Δεν υπάρχει οντότητα {0} με id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Δεν υπάρχει οντότητα {0}!",
"AbpDbConcurrencyErrorMessage": "Τα δεδομένα που έχετε υποβάλλει έχουν ήδη τροποποιηθεί από άλλον χρήστη/πελάτη. Απορρίψτε τις αλλαγές που κάνατε και δοκιμάστε από την αρχή.",
"Error": "Σφάλμα",
"UnhandledException": "Απρόσμενη Εξαίρεση!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/en-GB.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resource not found!",
"DefaultErrorMessage404Detail": "The resource requested could not be found on the server!",
"EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "There is no entity {0}!",
"Error": "Error",
"UnhandledException": "Unhandled exception!",
"Authorizing": "Authorizing…",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/en.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resource not found!",
"DefaultErrorMessage404Detail": "The resource requested could not be found on the server!",
"EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "There is no entity {0}!",
"AbpDbConcurrencyErrorMessage": "The data you have submitted has already been changed by another user. Discard your changes and try again.",
"Error": "Error",
"UnhandledException": "Unhandled exception!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/es.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Recurso no encontrado!",
"DefaultErrorMessage404Detail": "El recurso solitiado podría no encontrarse en el servidor!",
"EntityNotFoundErrorMessage": "No hay una entidad {0} con id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "No hay una entidad {0}!",
"AbpDbConcurrencyErrorMessage": "Los datos que ha enviado ya han sido modificados por otro usuario/cliente. Descarte los cambios que ha realizado e inténtelo desde el principio.",
"Error": "Error",
"UnhandledException": "Excepción no manejada!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fa.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "منبع درخواستی یافت نشد!",
"DefaultErrorMessage404Detail": "منبع درخواستی در سرور یافت نشد!",
"EntityNotFoundErrorMessage": "هیچ موجودیتی {0} با id = {1} وجود ندارد!",
"EntityNotFoundErrorMessageWithoutId": "هیچ موجودیتی {0} وجود ندارد!",
"AbpDbConcurrencyErrorMessage": "اطلاعات ارسالی شما قبلاً توسط کاربر/مشتری دیگری تغییر یافته است. لطفاً تغییراتی را که انجام داده اید لغو کنید و مجددا تلاش فرمایید.",
"Error": "خطا",
"UnhandledException": "خطای پیش بینی نشده!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fi.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resurssia ei löydy!",
"DefaultErrorMessage404Detail": "Pyydettyä resurssia ei löytynyt palvelimelta!",
"EntityNotFoundErrorMessage": "Ei ole olemassa kohdetta {0}, jonka tunnus = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Ei ole olemassa kohdetta {0}!",
"AbpDbConcurrencyErrorMessage": "Toinen käyttäjä/asiakas on jo muuttanut lähettämiäsi tietoja. Hylkää tekemäsi muutokset ja yritä alusta.",
"Error": "Virhe",
"UnhandledException": "Käsittelemätön poikkeus!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/fr.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Ressource introuvable!",
"DefaultErrorMessage404Detail": "La ressource demandée est introuvable sur le serveur!",
"EntityNotFoundErrorMessage": "Il n'y a pas d'entité {0} avec id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Il n'y a pas d'entité {0}!",
"AbpDbConcurrencyErrorMessage": "Les données que vous avez soumises ont déjà été modifiées par un autre utilisateur/client. Veuillez ignorer les modifications que vous avez apportées et réessayer depuis le début.",
"Error": "Erreur",
"UnhandledException": "Exception non-gérée!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hi.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "संसाधन नही मिला!",
"DefaultErrorMessage404Detail": "अनुरोधित संसाधन सर्वर पर नहीं मिला!",
"EntityNotFoundErrorMessage": "Id = {1} के साथ कोई इकाई {0} नहीं है!",
"EntityNotFoundErrorMessageWithoutId": "कोई इकाई {0} नहीं है!",
"AbpDbConcurrencyErrorMessage": "आपके द्वारा सबमिट किया गया डेटा पहले ही किसी अन्य उपयोगकर्ता/क्लाइंट द्वारा बदल दिया गया है। कृपया अपने द्वारा किए गए परिवर्तनों को त्याग दें और शुरुआत से ही प्रयास करें।",
"Error": "त्रुटि",
"UnhandledException": "अनियंत्रित अपवाद!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hr.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resurs nije pronađen!",
"DefaultErrorMessage404Detail": "Zatraženi resurs nije pronađen na poslužitelju!",
"EntityNotFoundErrorMessage": "Ne postoji entitet {0} s ID = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Ne postoji entitet {0}!",
"AbpDbConcurrencyErrorMessage": "Podatke koje ste dostavili već je promijenio drugi korisnik/klijent. Odbacite promjene koje ste napravili i pokušajte ispočetka.",
"Error": "Greška",
"UnhandledException": "Neobrađena iznimka!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/hu.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Az erőforrás nem található!",
"DefaultErrorMessage404Detail": "A kért erőforrás nem található a szerveren",
"EntityNotFoundErrorMessage": "Nincs {0} elem, amelynek id értéke {1}!",
"EntityNotFoundErrorMessageWithoutId": "Nincs {0} elem!",
"AbpDbConcurrencyErrorMessage": "Az Ön által elküldött adatokat egy másik felhasználó/ügyfél már megváltoztatta. Kérjük, dobja el az elvégzett módosításokat, és próbálja elölről.",
"Error": "Nincs {0} elem, amelynek id értéke {1}!",
"UnhandledException": "Nem kezelt kivétel!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/is.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Auðlind fannst ekki!",
"DefaultErrorMessage404Detail": "Auðlindin sem óskað var eftir fannst ekki á netþjóninum!",
"EntityNotFoundErrorMessage": "Það er enginn eining {0} með id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Það er enginn eining {0}!",
"AbpDbConcurrencyErrorMessage": "Gögnunum sem þú hefur sent inn hefur þegar verið breytt af öðrum notanda/viðskiptavini. Fleygðu breytingunum sem þú hefur gert og reyndu frá upphafi.",
"Error": "Villa",
"UnhandledException": "Ómeðhöndluð villa",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/it.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Risorsa non trovata!",
"DefaultErrorMessage404Detail": "La risorsa richiesta non è stata trovata sul server!",
"EntityNotFoundErrorMessage": "Non esiste un'entità {0} con id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Non esiste un'entità {0}!",
"AbpDbConcurrencyErrorMessage": "I dati che hai inviato sono già stati modificati da un altro utente/cliente. Per favore scarta le modifiche che hai fatto e riprova dall'inizio.",
"Error": "Errore",
"UnhandledException": "Eccezione non gestita!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/nl.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Bron niet gevonden!",
"DefaultErrorMessage404Detail": "De gevraagde bron kan niet worden gevonden op de server!",
"EntityNotFoundErrorMessage": "Er is geen entiteit {0} met id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Er is geen entiteit {0}!",
"AbpDbConcurrencyErrorMessage": "De door u ingevulde gegevens zijn al gewijzigd door een andere gebruiker/klant. Negeer de wijzigingen die u heeft aangebracht en probeer het vanaf het begin.",
"Error": "Fout",
"UnhandledException": "Onverwerkte uitzondering!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/pl-PL.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Nie znaleziono zasobu!",
"DefaultErrorMessage404Detail": "Nie znaleziono zasobu z żądania na serwerze!",
"EntityNotFoundErrorMessage": "Nie istnieje encja {0} z id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Nie istnieje encja {0}!",
"AbpDbConcurrencyErrorMessage": "Przesłane przez Ciebie dane zostały już zmienione przez innego użytkownika/klienta. Odrzuć wprowadzone zmiany i spróbuj od początku.",
"Error": "Błąd",
"UnhandledException": "Nieobsługiwany wyjątek!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/pt-BR.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Recurso não encontrado!",
"DefaultErrorMessage404Detail": "O recurso requisitado não pode ser encontrado pelo servidor!",
"EntityNotFoundErrorMessage": "Não existe uma entidade {0} com código = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Não existe uma entidade {0}!",
"AbpDbConcurrencyErrorMessage": "Os dados que você enviou já foram alterados por outro usuário/cliente. Descarte as alterações feitas e tente desde o início.",
"Error": "Erro",
"UnhandledException": "Exceção não tratada!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ro-RO.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resursa nu a fost găsită!",
"DefaultErrorMessage404Detail": "Resursa solicitată nu a fost găsită pe server!",
"EntityNotFoundErrorMessage": "Nu există entitatea {0} cu id-ul {1}!",
"EntityNotFoundErrorMessageWithoutId": "Nu există entitatea {0}!",
"AbpDbConcurrencyErrorMessage": "Datele pe care le-aţi trimis au fost modificate deja de către alt utilizator/client. Vă rugăm să renunţaţi la modificările pe care le-aţi făcut şi să încercaţi de la început.",
"Error": "Eroare",
"UnhandledException": "Excepţie netratată!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/ru.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Ресурс не найден!",
"DefaultErrorMessage404Detail": "Запрошенный ресурс не удалось найти на сервере!",
"EntityNotFoundErrorMessage": "Нет объекта {0} с id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Нет объекта {0}!",
"AbpDbConcurrencyErrorMessage": "Отправленные вами данные уже были изменены другим пользователем/клиентом. Отмените внесенные вами изменения и попробуйте с самого начала.",
"Error": "Ошибка",
"UnhandledException": "Непредвиденная ошибка!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sk.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Zdroj nebol nájdený!",
"DefaultErrorMessage404Detail": "Požadovaný zdroj sa na serveri nenašiel!",
"EntityNotFoundErrorMessage": "Entita {0} s id = {1} neexistuje!",
"EntityNotFoundErrorMessageWithoutId": "Entita {0} neexistuje!",
"AbpDbConcurrencyErrorMessage": "Údaje, ktoré ste odoslali, už zmenil iný používateľ/klient. Zahoďte zmeny, ktoré ste vykonali, a skúste to od začiatku.",
"Error": "Error",
"UnhandledException": "Neošetrená výnimka!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sl.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Vir ni bil najden!",
"DefaultErrorMessage404Detail": "Zahtevanega vira ni bilo mogoče najti na strežniku!",
"EntityNotFoundErrorMessage": "Ni entitete {0} z id-jem = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Ni entitete {0}!",
"AbpDbConcurrencyErrorMessage": "Podatke, ki ste jih poslali, je že spremenil drug uporabnik/stranka. Zavrzite spremembe, ki ste jih naredili, in poskusite od začetka.",
"Error": "Napaka",
"UnhandledException": "Neobravnavana napaka!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/sv.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Resurs hittades inte!",
"DefaultErrorMessage404Detail": "Den begärda resursen kunde inte hittas på servern!",
"EntityNotFoundErrorMessage": "Det finns ingen entitet {0} med id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Det finns ingen entitet {0}!",
"AbpDbConcurrencyErrorMessage": "De uppgifter du har skickat har redan ändrats av en annan användare. Kassera dina ändringar och försök igen.",
"Error": "Fel",
"UnhandledException": "Obehandlat undantag!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/tr.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Kaynak bulunamadı!",
"DefaultErrorMessage404Detail": "İstenilen kaynak sunucuda bulunamadı.",
"EntityNotFoundErrorMessage": "Id değeri {1} olan {0} türünden bir nesne bulunamadı!",
"EntityNotFoundErrorMessageWithoutId": "{0} türünden bir nesne bulunamadı!",
"AbpDbConcurrencyErrorMessage": "Gönderdiğiniz veri başka bir kullanıcı/istemci tarafından değiştirilmiş. Lütfen işlemi iptal edip baştan deneyin.",
"Error": "Hata",
"UnhandledException": "Yakalanmamış hata!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/vi.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "Tài nguyên không tìm thấy!",
"DefaultErrorMessage404Detail": "Tài nguyên được yêu cầu không được tìm thấy trên máy chủ!",
"EntityNotFoundErrorMessage": "Không có thực thể nào {0} với id = {1}!",
"EntityNotFoundErrorMessageWithoutId": "Không có thực thể nào {0}!",
"AbpDbConcurrencyErrorMessage": "Dữ liệu bạn gửi đã bị người dùng/khách hàng khác thay đổi. Vui lòng hủy các thay đổi bạn đã thực hiện và thử lại từ đầu.",
"Error": "Lỗi",
"UnhandledException": "Tình huống ngoại lệ không thể xử lí được!",

1
framework/src/Volo.Abp.ExceptionHandling/Volo/Abp/ExceptionHandling/Localization/zh-Hans.json

@ -13,6 +13,7 @@
"DefaultErrorMessage404": "未找到资源!",
"DefaultErrorMessage404Detail": "服务器上找不到所请求的资源!",
"EntityNotFoundErrorMessage": "不存在 id = {1} 的实体 {0}!",
"EntityNotFoundErrorMessageWithoutId": "不存在实体 {0}!",
"AbpDbConcurrencyErrorMessage": "您提交的数据已被其他用户/客户更改。请放弃您所做的更改并从头开始尝试。",
"Error": "错误",
"UnhandledException": "未处理异常!",

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save