MyBookmark/Modules.User.Application/Queries/GetAccountSessionsQuery.cs
THE_KONDRAT 7b16d72329 ui and login
mongo => postgres
2024-11-03 16:08:39 +03:00

17 lines
584 B
C#

using MediatR;
using Modules.User.Application.Gateways;
namespace Modules.User.Application.Queries;
public class GetAccountSessionsQuery : IRequest<List<Models.Session>>
{
public Guid AccountId { get; set; } = default!;
}
public class GetAccountSessionsQueryHandler(IAccountGateway accountGateway) : IRequestHandler<GetAccountSessionsQuery, List<Models.Session>>
{
public async Task<List<Models.Session>> Handle(GetAccountSessionsQuery request, CancellationToken cancellationToken)
{
return await accountGateway.GetAccountSessions(request.AccountId);
}
}