@ -20,11 +20,16 @@ All features are individually usable. If you disable a feature, it completely di
## How to Install
> This module is depends on [BlobStoring](../../Blob-Storing.md) module, please install `BlobStoring` module first and add a provider. For more information, check the [documentation](../../Blob-Storing.md).
[ABP CLI](../../CLI.md) allows installing a module to a solution using the `add-module` command. You can install the CMS Kit module in a command-line terminal with the following command:
```bash
abp add-module Volo.CmsKit
```
> By default, Cms-Kit is disabled by `GlobalFeature`. Because of that the initial migration will be empty. So you can skip the migration by adding `--skip-db-migrations` to command when installing if you are using Entity Framework Core. After enabling Cms-Kit global feture, please add new migration.
After the installation process, open the `GlobalFeatureConfigurator` class in the `Domain.Shared` project of your solution and place the following code into the `Configure` method to enable all the features in the CMS Kit module.
It requires to add `@using Volo.Abp.AspNetCore.Mvc.UI.Packages.SignalR` to your page/view.
@ -108,27 +108,27 @@ ABP automatically registers all the hubs to the [dependency injection](Dependenc
Example:
````csharp
```csharp
public class MessagingHub : Hub
{
//...
}
````
```
The hub route will be `/signalr-hubs/messaging` for the `MessagingHub`:
* Adding a standard `/signalr-hubs/` prefix
* Continue with the **camel case** hub name, without the `Hub` suffix.
- Adding a standard `/signalr-hubs/` prefix
- Continue with the **kebab-case** hub name, without the `Hub` suffix.
If you want to specify the route, you can use the `HubRoute` attribute:
````csharp
```csharp
[HubRoute("/my-messaging-hub")]
public class MessagingHub : Hub
{
//...
}
````
```
### AbpHub Base Classes
@ -136,7 +136,7 @@ Instead of the standard `Hub` and `Hub<T>` classes, you can inherit from the `Ab
Example:
````csharp
```csharp
public class MessagingHub : AbpHub
{
public async Task SendMessage(string targetUserName, string message)
@ -145,7 +145,7 @@ public class MessagingHub : AbpHub
var txt = L["MyText"]; //Localization
}
}
````
```
> While you could inject the same properties into your hub constructor, this way simplifies your hub class.
@ -153,9 +153,9 @@ public class MessagingHub : AbpHub
ABP automatically registers all the hubs to the [dependency injection](Dependency-Injection.md) as a **transient service**. If you want to **disable auto dependency injection** registration for your hub class, just add a `DisableConventionalRegistration` attribute. You can still register your hub class to dependency injection in the `ConfigureServices` method of your module if you like:
````csharp
```csharp
context.Services.AddTransient<MessagingHub>();
````
```
When **you or ABP** register the class to the dependency injection, it is automatically mapped to the endpoint route configuration just as described in the previous sections. You can use `DisableAutoHubMap` attribute if you want to manually map your hub class.
@ -163,7 +163,7 @@ For manual mapping, you have two options:
1. Use the `AbpSignalROptions` to add your map configuration (in the `ConfigureServices` method of your [module](Module-Development-Basics.md)), so ABP still performs the endpoint mapping for your hub:
This is the way you can modify the options of a hub class defined in a depended module (where you don't have the source code access).
2. Change `app.UseConfiguredEndpoints` in the `OnApplicationInitialization` method of your [module](Module-Development-Basics.md) as shown below (added a lambda method as the parameter).
* [Real-Time Messaging In A Distributed Architecture Using ABP, SingalR & RabbitMQ](https://volosoft.com/blog/RealTime-Messaging-Distributed-Architecture-Abp-SingalR-RabbitMQ)
- [Real-Time Messaging In A Distributed Architecture Using ABP, SingalR & RabbitMQ](https://volosoft.com/blog/RealTime-Messaging-Distributed-Architecture-Abp-SingalR-RabbitMQ)