Add project files.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using VizhTalk.BuildingBlocks.Application.Contract;
|
||||
using VizhTalk.BuildingBlocks.Domain.Contract;
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Configuration.Commnad;
|
||||
|
||||
public interface ICommandHandler<in TCommand>
|
||||
where TCommand : ICommand
|
||||
{
|
||||
Task Handle(TCommand request, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public interface ICommandHandler<in TCommand, TResult>
|
||||
where TCommand : ICommand<TResult>
|
||||
{
|
||||
Task<TResult> Handle(TCommand request, CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using VizhTalk.BuildingBlocks.Domain.Contract;
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Contract;
|
||||
|
||||
public interface INotificationHandler<T>
|
||||
where T : INotification
|
||||
{
|
||||
Task Handle(T notification, CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using VizhTalk.BuildingBlocks.Application.Contract;
|
||||
using VizhTalk.BuildingBlocks.Domain.Contract;
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Configuration.Query;
|
||||
|
||||
public interface IQueryHandler<in TQuery, TResult>
|
||||
where TQuery : IQuery<TResult>
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Contract;
|
||||
|
||||
public interface IExecutionContextAccessor
|
||||
{
|
||||
Guid UserId { get; }
|
||||
|
||||
Guid CorrelationId { get; }
|
||||
|
||||
bool IsAvailable { get; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using VizhTalk.BuildingBlocks.Domain;
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Events;
|
||||
|
||||
public class DomainNotificationBase<T> : IDomainEventNotification<T>
|
||||
where T : IDomainEvent
|
||||
{
|
||||
public T DomainEvent { get; }
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
public DomainNotificationBase(T domainEvent, Guid id)
|
||||
{
|
||||
this.Id = id;
|
||||
this.DomainEvent = domainEvent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using VizhTalk.BuildingBlocks.Application.Contract;
|
||||
using VizhTalk.BuildingBlocks.Domain.Contract;
|
||||
|
||||
namespace VizhTalk.BuildingBlocks.Application.Events;
|
||||
|
||||
public interface IDomainEventNotification<out TEventType> : IDomainEventNotification
|
||||
{
|
||||
TEventType DomainEvent { get; }
|
||||
}
|
||||
|
||||
public interface IDomainEventNotification : INotification
|
||||
{
|
||||
Guid Id { get; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace VizhTalk.BuildingBlocks.Application.Outbox;
|
||||
|
||||
public interface IOutbox
|
||||
{
|
||||
void Add(OutboxMessage message);
|
||||
|
||||
Task Save();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace VizhTalk.BuildingBlocks.Application.Outbox;
|
||||
|
||||
public class OutboxMessage
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTime OccurredOn { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public string Data { get; set; }
|
||||
|
||||
public DateTime? ProcessedDate { get; set; }
|
||||
|
||||
public OutboxMessage(Guid id, DateTime occurredOn, string type, string data)
|
||||
{
|
||||
this.Id = id;
|
||||
this.OccurredOn = occurredOn;
|
||||
this.Type = type;
|
||||
this.Data = data;
|
||||
}
|
||||
|
||||
private OutboxMessage()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VizhTalk.BuildingBlocks.Domain\VizhTalk.BuildingBlocks.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Data\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user