You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
751 B
28 lines
751 B
using App.Shared;
|
|
using Volo.Abp.Application.Services;
|
|
using Volo.Abp.EventBus.Distributed;
|
|
using Volo.Abp.Uow;
|
|
|
|
namespace App1.Services;
|
|
|
|
public class EventAppService : ApplicationService
|
|
{
|
|
protected IDistributedEventBus DistributedEventBus { get; }
|
|
|
|
public EventAppService(IDistributedEventBus distributedEventBus)
|
|
{
|
|
DistributedEventBus = distributedEventBus;
|
|
}
|
|
|
|
[UnitOfWork(false)]
|
|
public virtual async Task PublishAsync(string message)
|
|
{
|
|
await DistributedEventBus.PublishAsync(new TextMessageEto(message));
|
|
}
|
|
|
|
[UnitOfWork(true)]
|
|
public virtual async Task PublishInTransactionAsync(string message)
|
|
{
|
|
await DistributedEventBus.PublishAsync(new TextMessageEto(message));
|
|
}
|
|
}
|
|
|