Update
This commit is contained in:
+5
-2
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
public class CreateNewUserCommandHandler : IRequestHandler<CreateNewUserCommand, CreateNewUserResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class CreateNewUserCommandHandler : IRequestHandler<CreateNewUserCommand,
|
||||
|
||||
public async Task<CreateNewUserResponseDto> Handle(CreateNewUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewUserResponseDto();
|
||||
var response = await _context.Users.CreateNewUserAsync(request.Adapt<CreateNewUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewUserResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.DeleteUser;
|
||||
public class DeleteUserCommandHandler : IRequestHandler<DeleteUserCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class DeleteUserCommandHandler : IRequestHandler<DeleteUserCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(DeleteUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Users.DeleteUserAsync(request.Adapt<DeleteUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.UpdateUser;
|
||||
public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(UpdateUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Users.UpdateUserAsync(request.Adapt<UpdateUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilterQuery, GetAllUserByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilter
|
||||
|
||||
public async Task<GetAllUserByFilterResponseDto> Handle(GetAllUserByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserByFilterResponseDto();
|
||||
var response = await _context.Users.GetAllUserByFilterAsync(request.Adapt<GetAllUserByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllUserByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponse
|
||||
|
||||
public async Task<GetUserResponseDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserResponseDto();
|
||||
var response = await _context.Users.GetUserAsync(request.Adapt<GetUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetUserResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user